GNU-style array designators, causing us to emit broken initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67878
91177308-0d34-0410-b5e6-
96231b3b80d8
(Desig.getDesignator(0).isArrayDesignator() ||
Desig.getDesignator(0).isArrayRangeDesignator())) {
Diag(Tok, diag::ext_gnu_missing_equal_designator);
- return ParseInitializer();
+ return Actions.ActOnDesignatedInitializer(Desig, SourceLocation(),
+ true, ParseInitializer());
}
Diag(Tok, diag::err_expected_equal_designator);
-// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "<{ i8\* null, i32 1024 }>"
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "<{ i8\* null, i32 1024 }>" &&
+// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "i32 0, i32 22"
struct foo {
void *a;
.b = 1024,
};
}
+
+int b[2] = {
+ [1] 22
+};