diff options
| author | Steve Naroff <snaroff@apple.com> | 2008-06-03 17:15:29 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2008-06-03 17:15:29 +0000 |
| commit | aaf5108d266b409eb0edc8cec0104d47b6903ece (patch) | |
| tree | cad5499f8eaa7a318e02d9e8de7a2517637d2423 /clang/lib/AST/Expr.cpp | |
| parent | c0e9ff6e52beceb0affab6011363def6cb3bb5f0 (diff) | |
| download | bcm5719-llvm-aaf5108d266b409eb0edc8cec0104d47b6903ece.tar.gz bcm5719-llvm-aaf5108d266b409eb0edc8cec0104d47b6903ece.zip | |
Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC compatibility). Note FIXME.
Fix <rdar://problem/5977870> clang on xcode: error: arrays with static storage duration must have constant integer length
llvm-svn: 51907
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 5 |
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; } |

