aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 606b33f5f7..fd96e95afc 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1903,16 +1903,9 @@ static QualType TryToFixInvalidVariablyModifiedType(QualType T,
llvm::APSInt &Res = EvalResult.Val.getInt();
if (Res >= llvm::APSInt(Res.getBitWidth(), Res.isUnsigned())) {
- Expr* ArySizeExpr = VLATy->getSizeExpr();
- // FIXME: here we could "steal" (how?) ArySizeExpr from the VLA,
- // so as to transfer ownership to the ConstantArrayWithExpr.
- // Alternatively, we could "clone" it (how?).
- // Since we don't know how to do things above, we just use the
- // very same Expr*.
- return Context.getConstantArrayWithExprType(VLATy->getElementType(),
- Res, ArySizeExpr,
- ArrayType::Normal, 0,
- VLATy->getBracketsRange());
+ // TODO: preserve the size expression in declarator info
+ return Context.getConstantArrayType(VLATy->getElementType(),
+ Res, ArrayType::Normal, 0);
}
SizeIsNegative = true;