1// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s 2 3namespace aggregate { 4 // Direct list initialization does NOT allow braces to be elided! 5 struct S { 6 int ar[2]; 7 struct T { 8 int i1; 9 int i2; 10 } t; 11 struct U { 12 int i1; 13 } u[2]; 14 struct V { 15 int var[2]; 16 } v; 17 }; 18 19 void test() { 20 S s1 = { 1, 2, 3 ,4, 5, 6, 7, 8 }; // no-error 21 S s2{ {1, 2}, {3, 4}, { {5}, {6} }, { {7, 8} } }; // completely braced 22 S s3{ 1, 2, 3, 4, 5, 6 }; // expected-error 5 {{cannot omit braces}} 23 S s4{ {1, 2}, {3, 4}, {5, 6}, { {7, 8} } }; // expected-error 2 {{cannot omit braces}} 24 S s5{ {1, 2}, {3, 4}, { {5}, {6} }, {7, 8} }; // expected-error {{cannot omit braces}} 25 } 26} 27