diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /test/SemaCXX/cxx0x-initializer-constructor.cpp | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-constructor.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-constructor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-constructor.cpp b/test/SemaCXX/cxx0x-initializer-constructor.cpp index 09aca24..223e140 100644 --- a/test/SemaCXX/cxx0x-initializer-constructor.cpp +++ b/test/SemaCXX/cxx0x-initializer-constructor.cpp @@ -279,5 +279,28 @@ namespace PR12498 { { c->foo({ nullptr, 1 }); // expected-error{{initialization of incomplete type 'const PR12498::ArrayRef'}} } +} + +namespace explicit_default { + struct A { + explicit A(); // expected-note{{here}} + }; + A a {}; // ok + // This is copy-list-initialization, and we choose an explicit constructor + // (even though we do so via value-initialization), so the initialization is + // ill-formed. + A b = {}; // expected-error{{chosen constructor is explicit}} +} +namespace init_list_default { + struct A { + A(std::initializer_list<int>); + }; + A a {}; // calls initializer list constructor + + struct B { + B(); + B(std::initializer_list<int>) = delete; + }; + B b {}; // calls default constructor } |