From d1b6c770bea9b3da66c6c1eb9a7c483ed7e55c1e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 29 Jan 2017 20:58:47 +0000 Subject: Vendor import of clang release_40 branch r293443: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293443 --- lib/Sema/SemaInit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Sema/SemaInit.cpp') diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 45eff5ee6b621..b053c83c3f69d 100644 --- a/lib/Sema/SemaInit.cpp +++ b/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(), -- cgit v1.2.3