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