diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-19 16:31:05 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-19 16:31:05 +0000 |
commit | 772291a67d483c1c2abf324eec5d8d6ca476bfdc (patch) | |
tree | 0ef58060d88a3704823c5d362e1604d693543c83 /test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | |
parent | 4b45d7ff9c45ecf6126c4bb939057687483a9726 (diff) |
Emit a warning when list-initializing a std::initializer_list member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index bfe3f7991e..6c299c7d8a 100644 --- a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -127,3 +127,12 @@ void dangle() { new auto{1, 2, 3}; // expected-error {{cannot use list-initialization}} new std::initializer_list<int>{1, 2, 3}; // expected-warning {{at the end of the full-expression}} } + +struct haslist1 { + std::initializer_list<int> il = {1, 2, 3}; // expected-warning{{at the end of the constructor}} + haslist1(); +}; + +haslist1::haslist1() +: il{1, 2, 3} // expected-warning{{at the end of the constructor}} +{} |