summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-19 20:13:50 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-19 20:13:50 +0000
commit115652db4af81d77d3de1ade54f4de0faf6bc0fb (patch)
tree99772397791a401b024facff927df7e12b9d3192 /clang/lib/AST/Expr.cpp
parent3234db1e13d4fa60aa2341b83dc78c9030b3740b (diff)
downloadbcm5719-llvm-115652db4af81d77d3de1ade54f4de0faf6bc0fb.tar.gz
bcm5719-llvm-115652db4af81d77d3de1ade54f4de0faf6bc0fb.zip
Fix handling of the GNU "t ? : f" extension to the conditional
operator in C++, and verify that template instantiation for the condition operator does the right thing. llvm-svn: 72127
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 6bafdf278d8..2df76a29048 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -828,16 +828,16 @@ Expr::isLvalueResult Expr::isLvalueInternal(ASTContext &Ctx) const {
// casts should be wrapped by ImplicitCastExprs. There's just the special
// case involving throws to work out.
const ConditionalOperator *Cond = cast<ConditionalOperator>(this);
- Expr *LHS = Cond->getLHS();
- Expr *RHS = Cond->getRHS();
+ Expr *True = Cond->getTrueExpr();
+ Expr *False = Cond->getFalseExpr();
// C++0x 5.16p2
// If either the second or the third operand has type (cv) void, [...]
// the result [...] is an rvalue.
- if (LHS->getType()->isVoidType() || RHS->getType()->isVoidType())
+ if (True->getType()->isVoidType() || False->getType()->isVoidType())
return LV_InvalidExpression;
// Both sides must be lvalues for the result to be an lvalue.
- if (LHS->isLvalue(Ctx) != LV_Valid || RHS->isLvalue(Ctx) != LV_Valid)
+ if (True->isLvalue(Ctx) != LV_Valid || False->isLvalue(Ctx) != LV_Valid)
return LV_InvalidExpression;
// That's it.
OpenPOWER on IntegriCloud