// RUN: rm -rf %t // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -fno-modules-error-recovery -I %S/Inputs/template-default-args -std=c++11 %s -DBEGIN= -DEND= // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -fno-modules-error-recovery -I %S/Inputs/template-default-args -std=c++11 %s -DBEGIN="namespace N {" -DEND="}" BEGIN template struct A; template struct B; template struct C; template struct D; template struct E {}; template struct H {}; template struct I {}; END #include "b.h" #include "d.h" BEGIN template struct A {}; template struct B {}; template struct B; template struct C; template struct D {}; template struct F {}; template struct G {}; template struct J {}; template struct J; struct K : J<> {}; END #include "c.h" BEGIN A<> a; B<> b; extern C<> c; D<> d; E<> e; F<> f; G<> g; // expected-error {{missing '#include "a.h"'; default argument of 'G' must be defined before it is used}} // expected-note@a.h:7 {{default argument declared here is not reachable}} H<> h; // expected-error {{missing '#include "a.h"'; default argument of 'H' must be defined before it is used}} // expected-note@a.h:8 {{default argument declared here is not reachable}} I<> i; L<> *l; END namespace DeferredLookup { template using X = U; template void f() { (void) X(); } template int n = X(); // expected-warning {{extension}} template struct S { X xt; enum E : int; }; template enum S::E : int { a = X() }; void test() { f(); n = 1; S s; S::E e = S::E::a; Indirect::B::C indirect; } }