diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-11-13 20:12:29 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-11-13 20:12:29 +0000 | 
| commit | 58e008d2a61a73aaa2af07958b15c6f451b92eac (patch) | |
| tree | ff0b4a4394e483dbf20d7465359c48f83053d8d4 /clang/lib/AST/Expr.cpp | |
| parent | f8cfd1647ec0be5fe9310c838eabdc1af8313d64 (diff) | |
| download | bcm5719-llvm-58e008d2a61a73aaa2af07958b15c6f451b92eac.tar.gz bcm5719-llvm-58e008d2a61a73aaa2af07958b15c6f451b92eac.zip | |
Some cleanup for the implementation of built-in operator
candidates. Thanks to Chris for the review!
llvm-svn: 59260
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 21 | 
1 files changed, 10 insertions, 11 deletions
| diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index c320cfc6701..249bebc91fc 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -397,19 +397,18 @@ Expr::isLvalueResult Expr::isLvalue(ASTContext &Ctx) const {    case BinaryOperatorClass:    case CompoundAssignOperatorClass: {      const BinaryOperator *BinOp = cast<BinaryOperator>(this); -    if (BinOp->isAssignmentOp()) { -      if (Ctx.getLangOptions().CPlusPlus) -        // C++ [expr.ass]p1:  -        //   The result of an assignment operation [...] is an lvalue. -        return LV_Valid; -      else  -        // C99 6.5.16: -        //   An assignment expression [...] is not an lvalue. -        return LV_InvalidExpression; -    } else +    if (!BinOp->isAssignmentOp())        return LV_InvalidExpression; -    break; +    if (Ctx.getLangOptions().CPlusPlus) +      // C++ [expr.ass]p1:  +      //   The result of an assignment operation [...] is an lvalue. +      return LV_Valid; + + +    // C99 6.5.16: +    //   An assignment expression [...] is not an lvalue. +    return LV_InvalidExpression;    }    case CallExprClass: {      // C++ [expr.call]p10: | 

