diff options
author | Larisse Voufo <lvoufo@google.com> | 2015-01-27 18:47:05 +0000 |
---|---|---|
committer | Larisse Voufo <lvoufo@google.com> | 2015-01-27 18:47:05 +0000 |
commit | 19d08672844ee7558910d9880555b111fc3c90b3 (patch) | |
tree | 2a0eb5add4adbe1b8b7eb8090c51e675c2b8a5f9 /clang/test/SemaCXX/explicit.cpp | |
parent | ba1b6a16c444690ac2ba9513536a3fc2f1822406 (diff) | |
download | bcm5719-llvm-19d08672844ee7558910d9880555b111fc3c90b3.tar.gz bcm5719-llvm-19d08672844ee7558910d9880555b111fc3c90b3.zip |
Implement the remaining portion of DR1467 from r227022. I may have overlooked a few things, but this implementation comes straight from the DR resolution itself.
llvm-svn: 227224
Diffstat (limited to 'clang/test/SemaCXX/explicit.cpp')
-rw-r--r-- | clang/test/SemaCXX/explicit.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/test/SemaCXX/explicit.cpp b/clang/test/SemaCXX/explicit.cpp index 155141c058c..a3902e5d10f 100644 --- a/clang/test/SemaCXX/explicit.cpp +++ b/clang/test/SemaCXX/explicit.cpp @@ -56,7 +56,7 @@ namespace Conversion { void testExplicit() { // Taken from 12.3.2p2 - class X { X(); }; // expected-note+ {{candidate constructor}} + class X { X(); }; class Y { }; // expected-note+ {{candidate constructor (the implicit}} struct Z { @@ -89,14 +89,10 @@ namespace Conversion { const Y& y11{z}; // expected-error {{excess elements}} expected-note {{in initialization of temporary of type 'const Y'}} const int& y12{z}; - // X is not an aggregate, so constructors are considered. - // However, by 13.3.3.1/4, only standard conversion sequences and - // ellipsis conversion sequences are considered here, so this is not - // allowed. - // FIXME: It's not really clear that this is a sensible restriction for this - // case. g++ allows this, EDG does not. - const X x1{z}; // expected-error {{no matching constructor}} - const X& x2{z}; // expected-error {{no matching constructor}} + // X is not an aggregate, so constructors are considered, + // per 13.3.3.1/4 & DR1467. + const X x1{z}; + const X& x2{z}; } void testBool() { |