OSDN Git Service

* g++.dg/cdce3.C: Skip on alpha*-dec-osf5*.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / Wbraces2.C
1 // PR c++/20175
2 // { dg-options "-Wmissing-braces" }
3 int a[2][2] = { 0, 1, 2, 3 };                    // { dg-warning "missing braces" }
4 int b[2][2] = { { 0, 1 }, { 2, 3 } };
5 int c[2][2] = { { { 0 }, 1 }, { 2, 3 } };        // { dg-error "braces around scalar" }
6 struct S { char s[6]; int i; };
7 S d = { "hello", 1 };
8 S e = { { "hello" }, 1 };
9 S f = { { { "hello" } }, 1 };                    // { dg-error "braces around scalar" }
10 S g = { 'h', 'e', 'l', 'l', 'o', '\0', 1 };      // { dg-warning "missing braces" }
11 struct T { wchar_t s[6]; int i; };
12 T i = { L"hello", 1 };
13 T j = { { L"hello" }, 1 };
14 T k = { { { L"hello" } }, 1 };                   // { dg-error "braces around scalar" }
15 T l = { L'h', L'e', L'l', L'l', L'o', L'\0', 1 };// { dg-warning "missing braces" }