summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-13 20:12:29 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-13 20:12:29 +0000
commit58e008d2a61a73aaa2af07958b15c6f451b92eac (patch)
treeff0b4a4394e483dbf20d7465359c48f83053d8d4 /clang/lib/AST/Expr.cpp
parentf8cfd1647ec0be5fe9310c838eabdc1af8313d64 (diff)
downloadbcm5719-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.cpp21
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:
OpenPOWER on IntegriCloud