From 115652db4af81d77d3de1ade54f4de0faf6bc0fb Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 19 May 2009 20:13:50 +0000 Subject: 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 --- clang/lib/AST/Expr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/AST/Expr.cpp') 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(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. -- cgit v1.2.3