Skip to content

Commit 2d81994

Browse files
committed
[NFC] Add test from issue 61125
1 parent ddfdecb commit 2d81994

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

clang/test/Modules/befriend.cppm

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// RUN: rm -rf %t
2+
// RUN: mkdir %t
3+
// RUN: split-file %s %t
4+
//
5+
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
6+
// RUN: %clang_cc1 -std=c++20 %t/b.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o /dev/null -verify
7+
8+
//--- a.cppm
9+
module;
10+
11+
namespace n
12+
{
13+
14+
template<typename>
15+
struct a {
16+
template<typename T>
17+
friend void aa(a<T>);
18+
};
19+
20+
template<typename T>
21+
inline void aa(a<T>) {
22+
}
23+
24+
} //namespace n
25+
26+
export module a;
27+
28+
namespace n {
29+
30+
export using n::a;
31+
export using n::aa;
32+
33+
}
34+
35+
//--- b.cpp
36+
// expected-no-diagnostics
37+
import a;
38+
39+
void b() {
40+
aa(n::a<int>());
41+
}

0 commit comments

Comments
 (0)