]> granicus.if.org Git - clang/commitdiff
[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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242653 91177308-0d34-0410-b5e6-96231b3b80d8

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

index be760fe6f1d51c2cd5b1618825e051c3e542f1b3..19c80549d1ceb147eb601bf6fe9948d10bd710fc 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 2946013b6131e3159f42f3568c2d67ae236f0aac..30cddb374f97f3b8cfc1b6c8ded91676b0a3e4c0 100644 (file)
@@ -1,2 +1,4 @@
+BEGIN
 template<typename T = int> struct F;
 template<typename T, typename U> struct I;
+END
index dc44534302b2c821e30a0d5f2d00aa0294d31ca5..c2a6ddca2d7d68e027fc91593d7e5cade3f10396 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