Add PR check to suggest alternatives to using undef (#118506)
[llvm-project.git] / clang / test / Modules / Reachability-template-default-arg.cpp
blob35c647d0d344ba3ef49dba08e867448047dd6adf
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/template_default_arg.cppm -emit-module-interface -o %t/template_default_arg.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/template_default_arg.cppm -emit-reduced-module-interface -o %t/template_default_arg.pcm
9 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify
11 //--- template_default_arg.cppm
12 export module template_default_arg;
13 struct t {};
15 export template <typename T = t>
16 struct A {
17 T a;
20 //--- Use.cpp
21 import template_default_arg;
22 void bar() {
23 A<> a0;
24 A<t> a1; // expected-error {{declaration of 't' must be imported from module 'template_default_arg' before it is required}}
25 // expected-note@* {{declaration here is not visible}}