blob: c2a6ddca2d7d68e027fc91593d7e5cade3f10396 [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 Smith4440d6e2015-07-19 23:44:27 +000025END
Richard Smithe7bd6de2015-06-10 20:30:23 +000026
27#include "c.h"
Richard Smith87bb5692015-06-09 00:35:49 +000028
Richard Smith4440d6e2015-07-19 23:44:27 +000029BEGIN
Richard Smith87bb5692015-06-09 00:35:49 +000030A<> a;
31B<> b;
32extern C<> c;
33D<> d;
Richard Smithe7bd6de2015-06-10 20:30:23 +000034E<> e;
35F<> f;
Richard Smith35c1df52015-06-17 20:16:32 +000036G<> 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 +000037// expected-note@a.h:7 {{default argument declared here}}
Richard Smith4440d6e2015-07-19 23:44:27 +000038H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}}
39// expected-note@a.h:8 {{default argument declared here}}
Richard Smithafe800c2015-06-17 22:13:23 +000040I<> i;
Richard Smith4440d6e2015-07-19 23:44:27 +000041END