record, skip at least one element from the InitListExpr to avoid an infinite
loop if we're initializing an array of unknown bound.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164851
91177308-0d34-0410-b5e6-
96231b3b80d8
// If the record is invalid, some of it's members are invalid. To avoid
// confusion, we forgo checking the intializer for the entire record.
if (structDecl->isInvalidDecl()) {
+ // Assume it was supposed to consume a single initializer.
+ ++Index;
hadError = true;
return;
}
// Allowed by GNU extension
int a4[] = {}; // expected-error {{zero size arrays}}
+
+struct Incomplete; // expected-note {{forward declaration of 'Incomplete'}}
+struct A {
+ Incomplete i; // expected-error {{field has incomplete type 'Incomplete'}}
+};
+A a[] = { 0 }; // PR13971: don't hang.