[cfe-commits] r65609 - /cfe/trunk/lib/AST/Expr.cpp

Mike Stump mrs at apple.com
Thu Feb 26 19:16:57 PST 2009


Author: mrs
Date: Thu Feb 26 21:16:57 2009
New Revision: 65609

URL: http://llvm.org/viewvc/llvm-project?rev=65609&view=rev
Log:
The middle operand in ?: is optional, really.

Modified:
    cfe/trunk/lib/AST/Expr.cpp

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=65609&r1=65608&r2=65609&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Thu Feb 26 21:16:57 2009
@@ -334,7 +334,7 @@
     // The condition must be evaluated, but if either the LHS or RHS is a
     // warning, warn about them.
     const ConditionalOperator *Exp = cast<ConditionalOperator>(this);
-    if (Exp->getLHS()->isUnusedResultAWarning(Loc, R1, R2))
+    if (Exp->getLHS() && Exp->getLHS()->isUnusedResultAWarning(Loc, R1, R2))
       return true;
     return Exp->getRHS()->isUnusedResultAWarning(Loc, R1, R2);
   }





More information about the cfe-commits mailing list