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 | 2b013185f8b33f3bcd261e1b34bf61a22d48122b (patch) | |
tree | b0f6cbcd6809071797cea6db07253ef2f7449d9e /clang/test/SemaTemplate/instantiate-init.cpp | |
parent | 02b3d81a97365072632ee53bfe19a1b3cea542c5 (diff) | |
download | bcm5719-llvm-2b013185f8b33f3bcd261e1b34bf61a22d48122b.tar.gz bcm5719-llvm-2b013185f8b33f3bcd261e1b34bf61a22d48122b.zip |
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.
llvm-svn: 158288
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-init.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-init.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
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}} +} |