diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-03-30 23:39:01 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-03-30 23:39:01 +0000 |
commit | 29f80c343b20226a57e80a33c8279377c4094129 (patch) | |
tree | 57c17fdfc6a7e928600e404a2f6a0e44c4a57f40 /clang/lib/AST/ExprConstant.cpp | |
parent | dc572a326610eaf0972ece1790f61e5b6404727e (diff) | |
download | bcm5719-llvm-29f80c343b20226a57e80a33c8279377c4094129.tar.gz bcm5719-llvm-29f80c343b20226a57e80a33c8279377c4094129.zip |
Slight generalization for Evaluate with const variables.
llvm-svn: 68075
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index b0954e149c4..645811319a4 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -685,8 +685,8 @@ bool IntExprEvaluator::VisitDeclRefExpr(const DeclRefExpr *E) { } // 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)); |