VLAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72587
91177308-0d34-0410-b5e6-
96231b3b80d8
const llvm::APInt &ArySizeIn,
ArrayType::ArraySizeModifier ASM,
unsigned EltTypeQuals) {
+ assert((EltTy->isDependentType() || EltTy->isConstantSizeType()) &&
+ "Constant array of VLAs is illegal!");
+
// Convert the array size into a canonical width matching the pointer size for
// the target.
llvm::APInt ArySize(ArySizeIn);
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());