Binary conditional operator gave warnings where ternary operators
did not. They have been fixed to warn similarly to ternary operators.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33597 Build 33596: arc lint + arc unit
Event Timeline
clang/test/Sema/warn-binary-conditional-expression-unused.c | ||
---|---|---|
9 | Note to other reviewers: Whether or not we should warn on a here is another story and orthogonal to this patch, which focuses on just fixing existing inconsistency between ternary and gnu binary conditional that exists today. |
clang/lib/AST/Expr.cpp | ||
---|---|---|
2347–2348 | 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? |
clang/lib/AST/Expr.cpp | ||
---|---|---|
2347–2348 | 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. |
Thanks for the patch and following up on the review comments. Let's work on getting you commit access now.
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?