From: Mike Stump Date: Fri, 27 Feb 2009 03:16:57 +0000 (+0000) Subject: The middle operand in ?: is optional, really. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=befbcf4e02756f252d1263774ef2249f0921c1c9;p=clang 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 ed51fbaa68..c0e8ad15e7 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -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(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); }