-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 41199 |
| Version | unspecified |
| OS | Linux |
| Attachments | Example cpp file to reproduce the error |
| Reporter | LLVM Bugzilla Contributor |
| CC | @chfast,@EugeneZelenko |
Extended Description
When I run
clang-tidy --checks="readability-*" -fix-errors example.cpp --
on the attached file, I get the following output:
1 warning generated.
example.cpp:3:9: warning: implicit conversion 'unsigned int' -> bool [readability-implicit-bool-conversion]
if (s) {
^
!= 0u
example.cpp:3:10: note: FIX-IT applied suggested code changes
if (s) {
^
clang-tidy applied 1 of 1 suggested fixes.
However, adding the '!= 0u' causes a new warning, when I re-run the checks:
clang-tidy --checks="readability-*" example.cpp --
1 warning generated.
example.cpp:3:14: warning: integer literal has suffix 'u', which is not uppercase [readability-uppercase-literal-suffix]
if (s != 0u) {
^~
U
It would be better if clang-tidy suggests an uppercase suffix (i.e., '!= 0U') in the first place.
clang-tidy --version
LLVM (http://llvm.org/):
LLVM version 8.0.0
Optimized build.
Default target: x86_64-unknown-linux-gnu
Host CPU: skylake