blob: 3a519f2d8a7c53d6172c4722ee13c7b9c869e0e1 [file] [log] [blame]
Richard Smith87bb5692015-06-09 00:35:49 +00001// RUN: rm -rf %t
Richard Smith4440d6e2015-07-19 23:44:27 +00002// 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="}"
Richard Smith87bb5692015-06-09 00:35:49 +00004
Richard Smith4440d6e2015-07-19 23:44:27 +00005BEGIN
Richard Smith87bb5692015-06-09 00:35:49 +00006template<typename T> struct A;
7template<typename T> struct B;
8template<typename T> struct C;
9template<typename T = int> struct D;
Richard Smithe7bd6de2015-06-10 20:30:23 +000010template<typename T = int> struct E {};
Richard Smith35c1df52015-06-17 20:16:32 +000011template<typename T> struct H {};
Richard Smithafe800c2015-06-17 22:13:23 +000012template<typename T = int, typename U = int> struct I {};
Richard Smith4440d6e2015-07-19 23:44:27 +000013END
Richard Smith87bb5692015-06-09 00:35:49 +000014
15#include "b.h"
16
Richard Smith4440d6e2015-07-19 23:44:27 +000017BEGIN
Richard Smith87bb5692015-06-09 00:35:49 +000018template<typename T = int> struct A {};
19template<typename T> struct B {};
20template<typename T = int> struct B;
21template<typename T = int> struct C;
22template<typename T> struct D {};
Richard Smithe7bd6de2015-06-10 20:30:23 +000023template<typename T> struct F {};
Richard Smith35c1df52015-06-17 20:16:32 +000024template<typename T> struct G {};
Richard Smith6dc8ae12015-08-17 20:24:17 +000025template<typename T> struct J {};
26template<typename T = int> struct J;
27struct K : J<> {};
Richard Smith4440d6e2015-07-19 23:44:27 +000028END
Richard Smithe7bd6de2015-06-10 20:30:23 +000029
30#include "c.h"
Richard Smith87bb5692015-06-09 00:35:49 +000031
Richard Smith4440d6e2015-07-19 23:44:27 +000032BEGIN
Richard Smith87bb5692015-06-09 00:35:49 +000033A<> a;
34B<> b;
35extern C<> c;
36D<> d;
Richard Smithe7bd6de2015-06-10 20:30:23 +000037E<> e;
38F<> f;
Richard Smith35c1df52015-06-17 20:16:32 +000039G<> g; // expected-error {{default argument of 'G' must be imported from module 'X.A' before it is required}}
Richard Smith35c1df52015-06-17 20:16:32 +000040// expected-note@a.h:7 {{default argument declared here}}
Richard Smith4440d6e2015-07-19 23:44:27 +000041H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}}
42// expected-note@a.h:8 {{default argument declared here}}
Richard Smithafe800c2015-06-17 22:13:23 +000043I<> i;
Richard Smith4440d6e2015-07-19 23:44:27 +000044END