diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-30 20:35:01 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-30 20:35:01 +0000 |
commit | 72be24f39c162448e53dd73cf57cc6357114361e (patch) | |
tree | 349406950a38da360e48d7918f5a118e9854de7d /lib/AST/Expr.cpp | |
parent | 42748ec5cb2d75fe0dbb3a6db5aee6c11b5dc190 (diff) |
Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 82526119e2..00662a53af 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1943,7 +1943,6 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) { case UnaryOperator::AddrOf: case UnaryOperator::Deref: return ICEDiag(2, E->getLocStart()); - case UnaryOperator::OffsetOf: case UnaryOperator::Extension: case UnaryOperator::LNot: case UnaryOperator::Plus: @@ -1952,7 +1951,11 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) { case UnaryOperator::Real: case UnaryOperator::Imag: return CheckICE(Exp->getSubExpr(), Ctx); + case UnaryOperator::OffsetOf: + break; } + + // OffsetOf falls through here. } case Expr::OffsetOfExprClass: { // Note that per C99, offsetof must be an ICE. And AFAIK, using |