The middle operand in ?: is optional, really.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65609 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index ed51fba..c0e8ad1 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -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);
}