summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-06-03 22:06:04 +0000
committerSteve Naroff <snaroff@apple.com>2008-06-03 22:06:04 +0000
commitb115be707de3c91f8d49bd978f6a6da7ba0b7231 (patch)
tree92d1796acefbc5d217551e68a5eeab995f65ccb1 /clang/lib/AST/Expr.cpp
parent13c360cec45a8b6bb7e4528eb0bcf0272f53e731 (diff)
downloadbcm5719-llvm-b115be707de3c91f8d49bd978f6a6da7ba0b7231.tar.gz
bcm5719-llvm-b115be707de3c91f8d49bd978f6a6da7ba0b7231.zip
Put back my temporary hack until Eli addresses this in a more complete fashion.
llvm-svn: 51920
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 357d711978b..a89fbd621a5 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -918,6 +918,11 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
if (!SubExpr->getType()->isArithmeticType() ||
!getType()->isIntegerType()) {
if (Loc) *Loc = SubExpr->getLocStart();
+ // GCC accepts pointers as an extension.
+ // FIXME: check getLangOptions().NoExtensions. At the moment, it doesn't
+ // appear possible to get langOptions() from the Expr.
+ if (SubExpr->getType()->isPointerType()) // && !NoExtensions
+ return true;
return false;
}
OpenPOWER on IntegriCloud