summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-02-19 16:31:05 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-02-19 16:31:05 +0000
commit73cfbebed4c3a7d49b7256667e7e357ddcee65e2 (patch)
tree449e5714eba2fde6b8f7ac6949d5aa8079f0b2af /clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
parent8558da19306a824f54108d026176cc4bdd8ee90e (diff)
downloadbcm5719-llvm-73cfbebed4c3a7d49b7256667e7e357ddcee65e2.tar.gz
bcm5719-llvm-73cfbebed4c3a7d49b7256667e7e357ddcee65e2.zip
Emit a warning when list-initializing a std::initializer_list member.
llvm-svn: 150933
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp')
-rw-r--r--clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
index bfe3f7991ea..6c299c7d8a1 100644
--- a/clang/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
+++ b/clang/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}}
+{}
OpenPOWER on IntegriCloud