[cfe-commits] r39583 - in /cfe/cfe/trunk: AST/Type.cpp Sema/SemaDecl.cpp

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:45:54 PDT 2007


Author: clattner
Date: Wed Jul 11 11:45:54 2007
New Revision: 39583

URL: http://llvm.org/viewvc/llvm-project?rev=39583&view=rev
Log:
fix two checks that should be integer-constant-exprs not just c-e's.

Modified:
    cfe/cfe/trunk/AST/Type.cpp
    cfe/cfe/trunk/Sema/SemaDecl.cpp

Modified: cfe/cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/Type.cpp?rev=39583&r1=39582&r2=39583&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/Type.cpp (original)
+++ cfe/cfe/trunk/AST/Type.cpp Wed Jul 11 11:45:54 2007
@@ -318,7 +318,7 @@
 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
     }
   }

Modified: cfe/cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaDecl.cpp?rev=39583&r1=39582&r2=39583&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaDecl.cpp Wed Jul 11 11:45:54 2007
@@ -33,7 +33,7 @@
 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;
     }





More information about the cfe-commits mailing list