diff options
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Sema/SemaInit.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/Sema/SemaInit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/llvm/tools/clang/lib/Sema/SemaInit.cpp b/gnu/llvm/tools/clang/lib/Sema/SemaInit.cpp index 45eff5ee6b6..b053c83c3f6 100644 --- a/gnu/llvm/tools/clang/lib/Sema/SemaInit.cpp +++ b/gnu/llvm/tools/clang/lib/Sema/SemaInit.cpp @@ -1684,7 +1684,7 @@ void InitListChecker::CheckArrayType(const InitializedEntity &Entity, // If this is an incomplete array type, the actual type needs to // be calculated here. llvm::APSInt Zero(maxElements.getBitWidth(), maxElements.isUnsigned()); - if (maxElements == Zero) { + if (maxElements == Zero && !Entity.isVariableLengthArrayNew()) { // Sizing an array implicitly to zero is not allowed by ISO C, // but is supported by GNU. SemaRef.Diag(IList->getLocStart(), |
