[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Modules / module-transtive-instantiation-2.cpp
blobb058cd77f43615f6f76c76d7f28e910da44d5258
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: %clang_cc1 -std=c++20 %S/Inputs/module-transtive-instantiation/Templ.cppm -emit-module-interface -o %t/Templ.pcm
4 // RUN: %clang_cc1 -std=c++20 %S/Inputs/module-transtive-instantiation/bar.cppm -emit-module-interface -fprebuilt-module-path=%t -o %t/bar.pcm
5 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %s -fsyntax-only -verify
7 import bar;
8 int foo() {
9 G<int> g; // expected-error {{declaration of 'G' must be imported from module 'Templ' before it is required}}
10 return g(); // expected-note@Inputs/module-transtive-instantiation/Templ.cppm:3 {{declaration here is not visible}}