OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wbraces2.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// PR c++/20175
// PR c++/20175
// { dg-options "-Wmissing-braces" }
// { dg-options "-Wmissing-braces" }
int a[2][2] = { 0, 1, 2, 3 };                    // { dg-warning "missing braces" }
int a[2][2] = { 0, 1, 2, 3 };                    // { dg-warning "missing braces" }
int b[2][2] = { { 0, 1 }, { 2, 3 } };
int b[2][2] = { { 0, 1 }, { 2, 3 } };
int c[2][2] = { { { 0 }, 1 }, { 2, 3 } };        // { dg-error "braces around scalar" }
int c[2][2] = { { { 0 }, 1 }, { 2, 3 } };        // { dg-error "braces around scalar" }
struct S { char s[6]; int i; };
struct S { char s[6]; int i; };
S d = { "hello", 1 };
S d = { "hello", 1 };
S e = { { "hello" }, 1 };
S e = { { "hello" }, 1 };
S f = { { { "hello" } }, 1 };                    // { dg-error "braces around scalar" }
S f = { { { "hello" } }, 1 };                    // { dg-error "braces around scalar" }
S g = { 'h', 'e', 'l', 'l', 'o', '\0', 1 };      // { dg-warning "missing braces" }
S g = { 'h', 'e', 'l', 'l', 'o', '\0', 1 };      // { dg-warning "missing braces" }
struct T { wchar_t s[6]; int i; };
struct T { wchar_t s[6]; int i; };
T i = { L"hello", 1 };
T i = { L"hello", 1 };
T j = { { L"hello" }, 1 };
T j = { { L"hello" }, 1 };
T k = { { { L"hello" } }, 1 };                   // { dg-error "braces around scalar" }
T k = { { { L"hello" } }, 1 };                   // { dg-error "braces around scalar" }
T l = { L'h', L'e', L'l', L'l', L'o', L'\0', 1 };// { dg-warning "missing braces" }
T l = { L'h', L'e', L'l', L'l', L'o', L'\0', 1 };// { dg-warning "missing braces" }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.