xref: /llvm-project/clang/test/Modules/Reachability-using-templates.cpp (revision da00c60dae0040185dc45039c4397f6e746548e9)
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/mod.templates.cppm -emit-module-interface -o %t/mod.templates.pcm
6 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
7 
8 // RUN: %clang_cc1 -std=c++20 %t/mod.templates.cppm -emit-reduced-module-interface -o %t/mod.templates.pcm
9 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
10 //
11 //--- mod.templates.cppm
12 export module mod.templates;
13 template <class> struct t {};
14 export template <class T> using u = t<T>;
15 
16 //--- Use.cpp
17 // expected-no-diagnostics
18 import mod.templates;
foo()19 void foo() {
20   u<int> v{};
21 }
22