Debian Codegraph @

clang/test/Modules/befriend.cppm

raw
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 }