Debian Codegraph @

clang/test/Modules/pr102349.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 export template<typename>
17 struct a;
18
19 template<typename>
20 struct a {
21 };
22
23 export template<typename T>
24 constexpr auto aa = a<T>();
25
26 //--- b.cppm
27 export module b;
28
29 import a;
30
31 static void b() {
32 static_cast<void>(a<void>());
33 }
34
35 //--- c.cppm
36 export module c;
37
38 import a;
39
40 static void c() {
41 static_cast<void>(aa<void>);
42 }
43
44 //--- d.cpp
45 // expected-no-diagnostics
46 import a;
47 import b;
48 import c;
49
50 static void d() {
51 static_cast<void>(a<void>());
52 }