diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-11-18 01:26:17 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 01:26:17 +0000 | 
| commit | 74112917b21bad069482a8f04fc0d3cf2003d56c (patch) | |
| tree | 1e793e17037ac0e0c490ede3eb9f611e1044d241 /clang/lib/Sema/SemaExpr.cpp | |
| parent | 30bd3277462274bb89a4c6d2211bb1555517c7f7 (diff) | |
| download | bcm5719-llvm-74112917b21bad069482a8f04fc0d3cf2003d56c.tar.gz bcm5719-llvm-74112917b21bad069482a8f04fc0d3cf2003d56c.zip | |
implement a fixme by making warnings for ++/-- on non-modifiable-lvalues better.
llvm-svn: 59484
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 9 | 
1 files changed, 2 insertions, 7 deletions
| diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 1abc5a31df7..61b6f7e577e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2368,7 +2368,7 @@ static bool CheckForModifiableLvalue(Expr *E, SourceLocation Loc, Sema &S) {    }    if (NeedType) -    S.Diag(Loc, Diag, E->getType().getAsString(), SR); +    S.Diag(Loc, Diag, E->getType().getAsString(), E->getSourceRange());    else      S.Diag(Loc, Diag, E->getSourceRange());    return true; @@ -2463,13 +2463,8 @@ QualType Sema::CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc) {    }    // At this point, we know we have a real, complex or pointer type.     // Now make sure the operand is a modifiable lvalue. -  Expr::isModifiableLvalueResult mlval = op->isModifiableLvalue(Context); -  if (mlval != Expr::MLV_Valid) { -    // FIXME: emit a more precise diagnostic... -    Diag(OpLoc, diag::err_typecheck_invalid_lvalue_incr_decr, -         op->getSourceRange()); +  if (CheckForModifiableLvalue(op, OpLoc, *this))      return QualType(); -  }    return resType;  } | 

