Debian Codegraph @

gcc/testsuite/g++.dg/init/brace2.C

raw
1 // { dg-do compile }
2 // [dcl.init] paragraph 13.
3 int x = { 2 };
4 const char * y = { "hello" };
5 int a = 2;
6 int b = { 2,3 }; // { dg-error "5:scalar object 'b' requires one element in initializer" }
7 int c = { { 2 } } ; // { dg-error "braces around scalar initializer" }
8 int d = {}; // { dg-error "initializer" "" { target { ! c++11 } } }
9 int e = {{}}; // { dg-error "braces around scalar initializer" }