[modules] Add (already passing) test for template default argument merging when the...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 19 Jul 2015 23:44:27 +0000 (23:44 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 19 Jul 2015 23:44:27 +0000 (23:44 +0000)
llvm-svn: 242653

clang/test/Modules/Inputs/template-default-args/a.h
clang/test/Modules/Inputs/template-default-args/c.h
clang/test/Modules/template-default-args.cpp

index be760fe..19c8054 100644 (file)
@@ -1,3 +1,4 @@
+BEGIN
 template<typename T = int> struct A {};
 template<typename T> struct B {};
 template<typename T> struct C;
@@ -5,3 +6,4 @@ template<typename T> struct D;
 template<typename T> struct E;
 template<typename T = int> struct G;
 template<typename T = int> struct H;
+END
index 2946013..30cddb3 100644 (file)
@@ -1,2 +1,4 @@
+BEGIN
 template<typename T = int> struct F;
 template<typename T, typename U> struct I;
+END
index dc44534..c2a6ddc 100644 (file)
@@ -1,6 +1,8 @@
 // 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
+// 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<typename T> struct A;
 template<typename T> struct B;
 template<typename T> struct C;
@@ -8,9 +10,11 @@ template<typename T = int> struct D;
 template<typename T = int> struct E {};
 template<typename T> struct H {};
 template<typename T = int, typename U = int> struct I {};
+END
 
 #include "b.h"
 
+BEGIN
 template<typename T = int> struct A {};
 template<typename T> struct B {};
 template<typename T = int> struct B;
@@ -18,9 +22,11 @@ template<typename T = int> struct C;
 template<typename T> struct D {};
 template<typename T> struct F {};
 template<typename T> struct G {};
+END
 
 #include "c.h"
 
+BEGIN
 A<> a;
 B<> b;
 extern C<> c;
@@ -28,7 +34,8 @@ D<> d;
 E<> e;
 F<> f;
 G<> g; // expected-error {{default argument of 'G' must be imported from module 'X.A' before it is required}}
-// expected-note@a.h:6 {{default argument declared here}}
-H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}}
 // expected-note@a.h:7 {{default argument declared here}}
+H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}}
+// expected-note@a.h:8 {{default argument declared here}}
 I<> i;
+END