diff options
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 3f911f5b0c..a6441c8d70 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -416,11 +416,13 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) { T = Context.getConstantArrayType(T, ConstVal, ASM, ATI.TypeQuals); } // If this is not C99, extwarn about VLA's and C99 array size modifiers. - if (!getLangOptions().C99 && - (ASM != ArrayType::Normal || - (ArraySize && !ArraySize->isValueDependent() && - !ArraySize->isIntegerConstantExpr(Context)))) - Diag(D.getIdentifierLoc(), diag::ext_vla); + if (!getLangOptions().C99) { + if (ArraySize && !ArraySize->isValueDependent() && + !ArraySize->isIntegerConstantExpr(Context)) + Diag(D.getIdentifierLoc(), diag::ext_vla); + else if (ASM != ArrayType::Normal || ATI.TypeQuals != 0) + Diag(D.getIdentifierLoc(), diag::ext_c99_array_usage); + } break; } case DeclaratorChunk::Function: |