Fixing bug https://llvm.org/bugs/show_bug.cgi?id=28854.
Implicit cast with ternary operator makes AST look in a way in which it feels reasonable to add second matcher to detect implicit casts in ternary operators.
Differential D23243
[clang-tidy] enhance modernize-use-bool-literals to check ternary operator omtcyfz on Aug 6 2016, 4:31 PM. Authored by
Details
Fixing bug https://llvm.org/bugs/show_bug.cgi?id=28854. Implicit cast with ternary operator makes AST look in a way in which it feels reasonable to add second matcher to detect implicit casts in ternary operators.
Diff Detail Event Timeline
Comment Actions Would it also make sense to support BinaryConditionalOperator as well as the ternary operator?
Comment Actions LGTM! We may want to consider BinaryConditionalOperator as well, but that can be in as a separate patch.
Comment Actions Well, I personally have never seen BinaryConditionalOperator in my life. And honestly I'm not a fan of supporting GNU extensions - what makes sense to me is to use BinaryConditionalOperator in a check which suggests not using GNU extensions. Anyway, I'd be glad if @alexfh could jump in and take a look.
Comment Actions Use shiny eachOf and bind everything to "literal" value.
Comment Actions LG with a nit.
|
Remove anyOf and anything. And the comment.