diff options
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index 860a4aa6c6ff1..f371891e54802 100644 --- a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -153,13 +153,14 @@ void dangle() { } struct haslist1 { - std::initializer_list<int> il = {1, 2, 3}; // expected-warning{{at the end of the constructor}} - std::initializer_list<int> jl{1, 2, 3}; // expected-warning{{at the end of the constructor}} + std::initializer_list<int> il // expected-note {{declared here}} + = {1, 2, 3}; // ok, unused + std::initializer_list<int> jl{1, 2, 3}; // expected-note {{default member init}} haslist1(); }; -haslist1::haslist1() -: il{1, 2, 3} // expected-warning{{at the end of the constructor}} +haslist1::haslist1() // expected-error {{backing array for 'std::initializer_list' member 'jl' is a temporary object}} +: il{1, 2, 3} // expected-error {{backing array for 'std::initializer_list' member 'il' is a temporary object}} {} namespace PR12119 { |