aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-05-29 20:17:55 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-05-29 20:17:55 +0000
commit587cbdfd95f4b0aaccc14b31f5debe85d5daf7ed (patch)
tree6defedc63ee77093df7492cc4ee30d7943e8872d /lib/Sema/SemaInit.cpp
parentbdad6b69f1214fb20116795f8e8cbf881e3017c6 (diff)
Add an assertion so that we don't accidentally build constant arrays of
VLAs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 6608e120f3..fada7fe0ad 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -909,7 +909,7 @@ void InitListChecker::CheckArrayType(InitListExpr *IList, QualType &DeclType,
if (!maxElementsKnown && elementIndex > maxElements)
maxElements = elementIndex;
}
- if (DeclType->isIncompleteArrayType()) {
+ if (!hadError && DeclType->isIncompleteArrayType()) {
// If this is an incomplete array type, the actual type needs to
// be calculated here.
llvm::APSInt Zero(maxElements.getBitWidth(), maxElements.isUnsigned());