diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-10 03:12:00 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-10 03:12:00 +0000 |
commit | ca5233044ef679840d1ad1c46a36b16e2ee8a6e1 (patch) | |
tree | 3867dd3ebbc1b6fe4d0e51ab5e17357ca9754d3f /test/SemaTemplate/instantiate-init.cpp | |
parent | 18b73eacc21c8a7c03168aa30c401d072cc6ffc9 (diff) |
PR13064: Store whether an in-class initializer uses direct or copy
initialization, and use that information to produce the right kind of
initialization during template instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-init.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-init.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/SemaTemplate/instantiate-init.cpp b/test/SemaTemplate/instantiate-init.cpp index f0ca9a5b21..612a0b7f62 100644 --- a/test/SemaTemplate/instantiate-init.cpp +++ b/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}} +} |