llvm-project/clang/test/Modules/forward-friend.cppm
Chuanqi Xu 76864e6af1 [C++20] [Modules] Don't find module for linkage for decls in global
module

Possibly fix https://github.com/llvm/llvm-project/issues/96693

The direct reason is that we are calculating the linkage for the
declaration too early so that the linkage got calculated incorrectly.

And after I look into the problem, I found it is completely not
necessary to calculate the linkage there. It is for ModulesTS. So I
simply removes that legacy experimental code and fix the issue.
2024-06-28 16:12:50 +08:00

23 lines
369 B
C++

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: cd %t
//
// RUN: %clang_cc1 -std=c++20 %t/m.cppm -fsyntax-only -verify
//--- foo.h
template <typename... U>
static void foo(U...) noexcept;
class A {
template <typename... U>
friend void foo(U...) noexcept;
};
//--- m.cppm
// expected-no-diagnostics
module;
#include "foo.h"
export module m;
export using ::A;