summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-06-03 21:01:11 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-06-03 21:01:11 +0000
commit149614bfe781be6244fce801bec33676291c4738 (patch)
tree871b740e1bc80ac525000f1f8a98ab3dd48f020f /clang/lib/AST/Expr.cpp
parenta7d8649f781eb85612601266801ff154ca601281 (diff)
downloadbcm5719-llvm-149614bfe781be6244fce801bec33676291c4738.tar.gz
bcm5719-llvm-149614bfe781be6244fce801bec33676291c4738.zip
Re-fix r51907 in a way which doesn't affect valid code. This essentially
moves the check for the invalid construct to a point where it doesn't affect other uses of isIntegerConstantExpr, and we can warn properly when the extension is used. This makes it a bit more complicated, but it's a lot cleaner. Steve, please tell me if this check is sufficient to handle the relevant system header. I know it's enough to handle the testcase, but I don't know what exactly the original looks like. llvm-svn: 51918
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index a89fbd621a5..357d711978b 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -918,11 +918,6 @@ 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