[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)
LLVM Continuous Integration via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 28 01:39:29 PST 2024
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` running on `systemz-1` while building `clang-tools-extra` at step 7 "ninja check 1".
Full details are available at: https://lab.llvm.org/buildbot/#/builders/136/builds/2164
<details>
<summary>Here is the relevant piece of the build log for the reference</summary>
```
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang Tools :: clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
Running ['clang-tidy', '/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp', '-fix', '--checks=-*,readability-implicit-bool-conversion', '-config={CheckOptions: { readability-implicit-bool-conversion.CheckConversionsToBool: false, readability-implicit-bool-conversion.CheckConversionsFromBool: true }}', '--', '-std=c23', '-std=c++11', '-nostdinc++']...
------------------------ clang-tidy output -----------------------
3 warnings generated.
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
49 | int intFromBool = boolValue; //
| ^
| static_cast<int>( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23: note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32: note: FIX-IT applied suggested code changes
49 | int intFromBool = boolValue; //
| ^
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27: warning: implicit conversion 'bool' -> 'float' [readability-implicit-bool-conversion]
52 | float floatFromBool = boolValue; //
| ^
| static_cast<float>( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27: note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36: note: FIX-IT applied suggested code changes
52 | float floatFromBool = boolValue; //
| ^
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25: warning: implicit conversion 'bool' -> 'char' [readability-implicit-bool-conversion]
55 | char charFromBool = boolValue; //
| ^
| static_cast<char>( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25: note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34: note: FIX-IT applied suggested code changes
55 | char charFromBool = boolValue; //
| ^
clang-tidy applied 6 of 6 suggested fixes.
------------------------------------------------------------------
diff -u /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp failed:
--- /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig 2024-12-28 10:21:36.702389431 +0100
+++ /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp 2024-12-28 10:21:36.772389431 +0100
@@ -46,12 +46,12 @@
// Conversions from bool to other types
bool boolValue = true;
- int intFromBool = boolValue; //
+ int intFromBool = static_cast<int>(boolValue); //
//
- float floatFromBool = boolValue; //
+ float floatFromBool = static_cast<float>(boolValue); //
//
...
```
</details>
https://github.com/llvm/llvm-project/pull/120087
More information about the cfe-commits
mailing list