Debian Codegraph @

clang/test/Modules/pr102360.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %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.cppm -emit-module-interface -o %t/b.pcm \
7 // RUN: -fprebuilt-module-path=%t
8 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \
9 // RUN: -fprebuilt-module-path=%t
10 // RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify \
11 // RUN: -fprebuilt-module-path=%t
12
13 //--- a.cppm
14 export module a;
15
16 template<typename>
17 constexpr auto impl = true;
18
19 export template<typename T>
20 void a() {
21 }
22
23 export template<typename T> requires impl<T>
24 void a() {
25 }
26
27 //--- b.cppm
28 export module b;
29
30 import a;
31
32 static void b() {
33 a<void>();
34 }
35
36 //--- c.cppm
37 export module c;
38
39 import a;
40
41 static void c() {
42 a<void>();
43 }
44
45 //--- d.cpp
46 // expected-no-diagnostics
47 import a;
48 import b;
49 import c;
50
51 static void d() {
52 a<void>();
53 }