[cfe-commits] r68075 - /cfe/trunk/lib/AST/ExprConstant.cpp

Eli Friedman eli.friedman at gmail.com
Mon Mar 30 16:39:02 PDT 2009


Author: efriedma
Date: Mon Mar 30 18:39:01 2009
New Revision: 68075

URL: http://llvm.org/viewvc/llvm-project?rev=68075&view=rev
Log:
Slight generalization for Evaluate with const variables.


Modified:
    cfe/trunk/lib/AST/ExprConstant.cpp

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=68075&r1=68074&r2=68075&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Mon Mar 30 18:39:01 2009
@@ -685,8 +685,8 @@
   }
 
   // In C++, const, non-volatile integers initialized with ICEs are ICEs.
-  if (Info.Ctx.getLangOptions().CPlusPlus &&
-      E->getType().getCVRQualifiers() == QualType::Const) {
+  // In C, they can also be folded, although they are not ICEs.
+  if (E->getType().getCVRQualifiers() == QualType::Const) {
     if (const VarDecl *D = dyn_cast<VarDecl>(E->getDecl())) {
       if (const Expr *Init = D->getInit())
         return Visit(const_cast<Expr*>(Init));





More information about the cfe-commits mailing list