From ab0b2df4699de3e7d9c9317655d6b8a82e9cf484 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 5 Jun 2007 04:12:06 +0000 Subject: [PATCH] fix two checks that should be integer-constant-exprs not just c-e's. llvm-svn: 39583 --- clang/AST/Type.cpp | 2 +- clang/Sema/SemaDecl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; }