diff options
Diffstat (limited to 'test/SemaCXX/cxx0x-initializer-aggregates.cpp')
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-aggregates.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/test/SemaCXX/cxx0x-initializer-aggregates.cpp b/test/SemaCXX/cxx0x-initializer-aggregates.cpp index f53ac6d..0e9a97d 100644 --- a/test/SemaCXX/cxx0x-initializer-aggregates.cpp +++ b/test/SemaCXX/cxx0x-initializer-aggregates.cpp @@ -4,7 +4,6 @@ struct one { char c[1]; }; struct two { char c[2]; }; namespace aggregate { - // Direct list initialization does NOT allow braces to be elided! struct S { int ar[2]; struct T { @@ -20,25 +19,25 @@ namespace aggregate { }; void bracing() { - S s1 = { 1, 2, 3 ,4, 5, 6, 7, 8 }; // no-error - S s2{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced - S s3{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}} - S s4{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}} - S s5{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}} + S s1 = { 1, 2, 3 ,4, 5, 6, 7, 8 }; + S s2{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; + S s3{ 1, 2, 3, 4, 5, 6 }; + S s4{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; + S s5{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; } void bracing_new() { - new S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced - new S{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}} - new S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}} - new S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}} + new S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; + new S{ 1, 2, 3, 4, 5, 6 }; + new S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; + new S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; } void bracing_construct() { - (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced - (void) S{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}} - (void) S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}} - (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}} + (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; + (void) S{ 1, 2, 3, 4, 5, 6 }; + (void) S{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; + (void) S{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; } struct String { |