// FIXME: Handle wide strings
if (StringLiteral *strLiteral = IsStringLiteralInit(Init, DeclType))
return CheckStringLiteralInit(strLiteral, DeclType);
+
+ if (DeclType->isArrayType())
+ return Diag(Init->getLocStart(),
+ diag::err_array_init_list_required,
+ Init->getSourceRange());
+
return CheckSingleInitializer(Init, DeclType);
}
unsigned newIndex = 0;
"'extern' variable has an initializer")
DIAG(err_variable_object_no_init, ERROR,
"variable-sized object may not be initialized")
+DIAG(err_array_init_list_required, ERROR,
+ "initialization with \"{...}\" expected for array")
DIAG(warn_excess_initializers, WARNING,
"excess elements in array initializer")
DIAG(err_excess_initializers_in_char_array_initializer, ERROR,
void *g = &x;
int *h = &x;
+int test() {
+int a[10];
+int b[10] = a; // expected-error {{initialization with "{...}" expected}}
+}