summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/brace2.C
blob: 619a20f3c70654c075c445c4ff791b4feeccf0f8 (plain)
1
2
3
4
5
6
7
8
// { dg-do compile }
// [dcl.init] paragraph 13.
int x = { 2 };
const char * y = { "hello" };
int a = 2;
int b = { 2,3 }; // { dg-error "requires one element in initializer" }
int c = { { 2 } } ; // { dg-error "braces around scalar initializer" }
int d = {}; // { dg-error "initializer" }