Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Modules / Reachability-template-default-arg.cpp
blob6fb109e41fcf0a0705d444dd0a6383faae1a796e
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
7 //
8 //--- template_default_arg.cppm
9 export module template_default_arg;
10 struct t {};
12 export template <typename T = t>
13 struct A {
14 T a;
17 //--- Use.cpp
18 import template_default_arg;
19 void bar() {
20 A<> a0;
21 A<t> a1; // expected-error {{declaration of 't' must be imported from module 'template_default_arg' before it is required}}
22 // expected-note@* {{declaration here is not visible}}