diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-13 22:12:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-13 22:12:09 +0000 |
commit | 430656e1c392dcd9f17fe91a495421d69fca1bc8 (patch) | |
tree | 113e805776b61255e5502b10a883173e43351b66 /lib/AST/Expr.cpp | |
parent | 07d68f1f0760110d430c4b849abd49f12777f09c (diff) |
fix test/CodeGen/statements.c on 32-bit hosts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 8516d41df6..0e4a29f916 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1281,6 +1281,13 @@ bool Expr::isConstantInitializer(ASTContext &Ctx) const { // cast-to-union extension. if (getType()->isRecordType()) return cast<CastExpr>(this)->getSubExpr()->isConstantInitializer(Ctx); + + // Integer->integer casts can be handled here, which is important for + // things like (int)(&&x-&&y). Scary but true. + if (getType()->isIntegerType() && + cast<CastExpr>(this)->getSubExpr()->getType()->isIntegerType()) + return cast<CastExpr>(this)->getSubExpr()->isConstantInitializer(Ctx); + break; } return isEvaluatable(Ctx); |