lebedev.ri added inline comments.
================
Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:164
+ while (i) {
+ // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from
'int' to 'bool' [cppcoreguidelines-narrowing-conversions]
+ }
----------------
courbet wrote:
> What about providing a fix for this one :
> `while (i != 0) {`
Is this //actually// a narrowing conversion as per the CPPCG?
Conversion to bool is a special case, it's not a truncation, but a `x != 0`.
I'd think cases like these where bool was pretty clearly meant (`if()`,
`while()`, `for()`, ???) should be exempt.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D53488
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits