fix two checks that should be integer-constant-exprs not just c-e's.

llvm-svn: 39583
This commit is contained in:
Chris Lattner 2007-06-05 04:12:06 +00:00
parent 946aa31f02
commit ab0b2df469
2 changed files with 2 additions and 2 deletions

View File

@ -318,7 +318,7 @@ bool Type::isAggregateType() const {
bool Type::isConstantSizeType(SourceLocation *loc) const {
if (const ArrayType *ary = dyn_cast<ArrayType>(CanonicalType)) {
if (Expr *size = ary->getSize()) {
if (!size->isConstantExpr(loc))
if (!size->isIntegerConstantExpr(loc))
return false; // Variable Length Array
}
}

View File

@ -33,7 +33,7 @@ using namespace clang;
bool Sema::isConstantArrayType(ArrayType *ary, SourceLocation loc) {
if (Expr *size = ary->getSize()) {
SourceLocation expLoc;
if (!size->isConstantExpr(&expLoc)) {
if (!size->isIntegerConstantExpr(&expLoc)) {
Diag(expLoc, diag::err_typecheck_illegal_vla);
return false;
}