diff options
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-references.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-references.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-references.cpp b/test/SemaCXX/cxx0x-initializer-references.cpp index d1a9ed30076f..390047ea0752 100644 --- a/test/SemaCXX/cxx0x-initializer-references.cpp +++ b/test/SemaCXX/cxx0x-initializer-references.cpp @@ -105,12 +105,13 @@ namespace inner_init { B b2 { { 0 } }; B b3 { { { 0 } } }; // expected-warning {{braces around scalar init}} - struct C { C(int); }; + struct C { C(int); }; // expected-note 2{{candidate constructor (the implicit}} \ + // expected-note {{candidate constructor not viable: cannot convert initializer list argument to 'int'}} struct D { C &&r; }; D d1 { 0 }; // ok, 0 implicitly converts to C D d2 { { 0 } }; // ok, { 0 } calls C(0) - D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 }) - D d4 { { { { 0 } } } }; // expected-warning {{braces around scalar init}} + D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 }), expected-warning {{braces around scalar init}} + D d4 { { { { 0 } } } }; // expected-error {{no matching constructor for initialization of 'inner_init::C &&'}} struct E { explicit E(int); }; // expected-note 2{{here}} struct F { E &&r; }; @@ -124,3 +125,7 @@ namespace PR20844 { struct B { operator A&(); } b; A &a{b}; // expected-error {{excess elements}} expected-note {{in initialization of temporary of type 'PR20844::A'}} } + +namespace PR21834 { +const int &a = (const int &){0}; // expected-error {{cannot bind to an initializer list}} +} |