summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/PCH/cxx-member-init.cpp4
-rw-r--r--clang/test/SemaTemplate/instantiate-init.cpp15
2 files changed, 17 insertions, 2 deletions
diff --git a/clang/test/PCH/cxx-member-init.cpp b/clang/test/PCH/cxx-member-init.cpp
index 28206652b8f..20594d532e3 100644
--- a/clang/test/PCH/cxx-member-init.cpp
+++ b/clang/test/PCH/cxx-member-init.cpp
@@ -12,10 +12,14 @@ struct S {
int &m = n;
S *that = this;
};
+template<typename T> struct X { T t {0}; };
#endif
#ifdef SOURCE
S s;
+
+struct E { explicit E(int); };
+X<E> x;
#elif HEADER
#undef HEADER
#define SOURCE
diff --git a/clang/test/SemaTemplate/instantiate-init.cpp b/clang/test/SemaTemplate/instantiate-init.cpp
index f0ca9a5b21e..612a0b7f621 100644
--- a/clang/test/SemaTemplate/instantiate-init.cpp
+++ b/clang/test/SemaTemplate/instantiate-init.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-struct X0 { // expected-note 4{{candidate}}
+struct X0 { // expected-note 8{{candidate}}
X0(int*, float*); // expected-note 4{{candidate}}
};
@@ -107,3 +107,14 @@ namespace PR7985 {
array_lengthof(Description<float*>::data); // expected-error{{no matching function for call to 'array_lengthof'}}
}
}
+
+namespace PR13064 {
+ // Ensure that in-class direct-initialization is instantiated as
+ // direct-initialization and likewise copy-initialization is instantiated as
+ // copy-initialization.
+ struct A { explicit A(int); }; // expected-note{{here}}
+ template<typename T> struct B { T a { 0 }; };
+ B<A> b;
+ template<typename T> struct C { T a = { 0 }; }; // expected-error{{explicit}}
+ C<A> c; // expected-note{{here}}
+}
OpenPOWER on IntegriCloud