forked from OSchip/llvm-project
fix two checks that should be integer-constant-exprs not just c-e's.
llvm-svn: 39583
This commit is contained in:
parent
946aa31f02
commit
ab0b2df469
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue