]> granicus.if.org Git - clang/commitdiff
The middle operand in ?: is optional, really.
authorMike Stump <mrs@apple.com>
Fri, 27 Feb 2009 03:16:57 +0000 (03:16 +0000)
committerMike Stump <mrs@apple.com>
Fri, 27 Feb 2009 03:16:57 +0000 (03:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65609 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp

index ed51fbaa68b17eac9aa17bc83a58397a4604c6aa..c0e8ad15e7362295565121a1bebb150a98456ad7 100644 (file)
@@ -334,7 +334,7 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1,
     // 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);
   }