aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 25fd5c39fe..e898782f31 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -399,12 +399,9 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) {
D.setInvalidType(true);
} else if (const RecordType *EltTy = T->getAsRecordType()) {
// If the element type is a struct or union that contains a variadic
- // array, reject it: C99 6.7.2.1p2.
- if (EltTy->getDecl()->hasFlexibleArrayMember()) {
- Diag(DeclType.Loc, diag::err_flexible_array_in_array) << T;
- T = Context.IntTy;
- D.setInvalidType(true);
- }
+ // array, accept it as a GNU extension: C99 6.7.2.1p2.
+ if (EltTy->getDecl()->hasFlexibleArrayMember())
+ Diag(DeclType.Loc, diag::ext_flexible_array_in_array) << T;
} else if (T->isObjCInterfaceType()) {
Diag(DeclType.Loc, diag::warn_objc_array_of_interfaces) << T;
}