[PATCH] D63369: [AST] Fixed extraneous warnings for binary conditional operator
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 17 09:49:49 PDT 2019
nickdesaulniers added inline comments.
================
Comment at: clang/lib/AST/Expr.cpp:2351-2352
return false;
if (!Exp->getLHS())
return true;
return Exp->getLHS()->isUnusedResultAWarning(WarnE, Loc, R1, R2, Ctx);
----------------
rsmith wrote:
> Looks like whoever wrote this expected to handle binary conditional operators here. Maybe delete this check since it's impossible for a ternary conditional operator?
I agree; I assume it's not possible for this case and that they meant to handle `BinaryConditionalOperatorClass`. This should make the the return value a simple logical and of the two sides; which more closely follows the comment above.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63369/new/
https://reviews.llvm.org/D63369
More information about the cfe-commits
mailing list