[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / Reachability-using-templates.cpp
blob65601c1cfe4e2df8c9df830162d63ad9e5035e8e
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
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
11 //--- mod.templates.cppm
12 export module mod.templates;
13 template <class> struct t {};
14 export template <class T> using u = t<T>;
16 //--- Use.cpp
17 // expected-no-diagnostics
18 import mod.templates;
19 void foo() {
20 u<int> v{};