diff --git a/clang/AST/Type.cpp b/clang/AST/Type.cpp index cf2c3ce76bd5..1eb7fd7eedde 100644 --- a/clang/AST/Type.cpp +++ b/clang/AST/Type.cpp @@ -318,7 +318,7 @@ bool Type::isAggregateType() const { bool Type::isConstantSizeType(SourceLocation *loc) const { if (const ArrayType *ary = dyn_cast(CanonicalType)) { if (Expr *size = ary->getSize()) { - if (!size->isConstantExpr(loc)) + if (!size->isIntegerConstantExpr(loc)) return false; // Variable Length Array } } diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp index a30944ba92c2..af0d7006660c 100644 --- a/clang/Sema/SemaDecl.cpp +++ b/clang/Sema/SemaDecl.cpp @@ -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; }