1 // RUN: rm -rf %t 2 // 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= 3 // 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="}" 4 5 BEGIN 6 template<typename T> struct A; 7 template<typename T> struct B; 8 template<typename T> struct C; 9 template<typename T = int> struct D; 10 template<typename T = int> struct E {}; 11 template<typename T> struct H {}; 12 template<typename T = int, typename U = int> struct I {}; 13 END 14 15 #include "b.h" 16 17 BEGIN 18 template<typename T = int> struct A {}; 19 template<typename T> struct B {}; 20 template<typename T = int> struct B; 21 template<typename T = int> struct C; 22 template<typename T> struct D {}; 23 template<typename T> struct F {}; 24 template<typename T> struct G {}; 25 END 26 27 #include "c.h" 28 29 BEGIN 30 A<> a; 31 B<> b; 32 extern C<> c; 33 D<> d; 34 E<> e; 35 F<> f; 36 G<> g; // expected-error {{default argument of 'G' must be imported from module 'X.A' before it is required}} 37 // [email protected]:7 {{default argument declared here}} 38 H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}} 39 // [email protected]:8 {{default argument declared here}} 40 I<> i; 41 END 42