r242653 - [modules] Add (already passing) test for template default argument merging when the template is declared in a namespace.
Richard Smith
richard-llvm at metafoo.co.uk
Sun Jul 19 16:44:28 PDT 2015
Author: rsmith
Date: Sun Jul 19 18:44:27 2015
New Revision: 242653
URL: http://llvm.org/viewvc/llvm-project?rev=242653&view=rev
Log:
[modules] Add (already passing) test for template default argument merging when the template is declared in a namespace.
Modified:
cfe/trunk/test/Modules/Inputs/template-default-args/a.h
cfe/trunk/test/Modules/Inputs/template-default-args/c.h
cfe/trunk/test/Modules/template-default-args.cpp
Modified: cfe/trunk/test/Modules/Inputs/template-default-args/a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/template-default-args/a.h?rev=242653&r1=242652&r2=242653&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/template-default-args/a.h (original)
+++ cfe/trunk/test/Modules/Inputs/template-default-args/a.h Sun Jul 19 18:44:27 2015
@@ -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
Modified: cfe/trunk/test/Modules/Inputs/template-default-args/c.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/template-default-args/c.h?rev=242653&r1=242652&r2=242653&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/template-default-args/c.h (original)
+++ cfe/trunk/test/Modules/Inputs/template-default-args/c.h Sun Jul 19 18:44:27 2015
@@ -1,2 +1,4 @@
+BEGIN
template<typename T = int> struct F;
template<typename T, typename U> struct I;
+END
Modified: cfe/trunk/test/Modules/template-default-args.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/template-default-args.cpp?rev=242653&r1=242652&r2=242653&view=diff
==============================================================================
--- cfe/trunk/test/Modules/template-default-args.cpp (original)
+++ cfe/trunk/test/Modules/template-default-args.cpp Sun Jul 19 18:44:27 2015
@@ -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 at 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 at 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 at a.h:8 {{default argument declared here}}
I<> i;
+END
More information about the cfe-commits
mailing list