Binary conditional operator gave warnings where ternary operators
did not. They have been fixed to warn similarly to ternary operators.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang/test/Sema/warn-binary-conditional-expression-unused.c | ||
---|---|---|
8 ↗ | (On Diff #204871) | 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 | ||
---|---|---|
2351–2352 ↗ | (On Diff #204871) | 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 | ||
---|---|---|
2351–2352 ↗ | (On Diff #204871) | 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. |
Comment Actions
Thanks for the patch and following up on the review comments. Let's work on getting you commit access now.