Put back my temporary hack until Eli addresses this in a more complete fashion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51920 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 357d711..a89fbd6 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -918,6 +918,11 @@
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;
}