[clang-tools-extra] [clang-tidy] Enable C99 in `implicit-bool-conversion` and avoid FP with `bool` operands in C23 (PR #171070)

via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 28 17:48:09 PST 2025


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 3009 tests passed
* 29 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang Tools
<details>
<summary>Clang Tools.clang-tidy/checkers/readability/implicit-bool-conversion-c99.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
C:/Python312/python.exe C:/_work/llvm-project/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py -std=c99-or-later C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\implicit-bool-conversion-c99.c readability-implicit-bool-conversion C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp
# executed command: C:/Python312/python.exe 'C:/_work/llvm-project/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py' -std=c99-or-later 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\implicit-bool-conversion-c99.c' readability-implicit-bool-conversion 'C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp'
# .---command stdout------------
# | Running ['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\implicit-bool-conversion-c99.c.tmp.c', '-fix', '--checks=-*,readability-implicit-bool-conversion', '--config={}', '--', '-std=c99', '-nostdinc++']...
# | ------------------------ clang-tidy output -----------------------
# | 4 warnings generated.
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
# |    24 |   _Bool raw_bool = 1;
# |       |                    ^
# |       |                    true
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    27 |   int i = raw_bool;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    34 |   int i = b + 1;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:13: warning: implicit conversion 'int *' -> 'bool' [readability-implicit-bool-conversion]
# |    40 |   _Bool b = p;
# |       |             ^
# |       |               != 0
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:14: note: FIX-IT applied suggested code changes
# | clang-tidy applied 4 of 4 suggested fixes.
# | 
# |    40 |   _Bool b = p;
# |       |              ^
# | 
# | ------------------------------------------------------------------
# | diff -u C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c failed:
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.553104900 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.588811800 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != 0;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------ Fixes -----------------------------
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.553104900 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.588811800 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != 0;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------------------------------------------
# | Running ['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\implicit-bool-conversion-c99.c.tmp.c', '-fix', '--checks=-*,readability-implicit-bool-conversion', '--config={}', '--', '-std=c11', '-nostdinc++']...
# | ------------------------ clang-tidy output -----------------------
# | 4 warnings generated.
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
# |    24 |   _Bool raw_bool = 1;
# |       |                    ^
# |       |                    true
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    27 |   int i = raw_bool;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    34 |   int i = b + 1;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:13: warning: implicit conversion 'int *' -> 'bool' [readability-implicit-bool-conversion]
# |    40 |   _Bool b = p;
# |       |             ^
# |       |               != 0
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:14: note: FIX-IT applied suggested code changes
# | clang-tidy applied 4 of 4 suggested fixes.
# | 
# |    40 |   _Bool b = p;
# |       |              ^
# | 
# | ------------------------------------------------------------------
# | diff -u C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c failed:
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.658148800 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.691403600 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != 0;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------ Fixes -----------------------------
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.658148800 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.691403600 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != 0;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------------------------------------------
# | Running ['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\implicit-bool-conversion-c99.c.tmp.c', '-fix', '--checks=-*,readability-implicit-bool-conversion', '--config={}', '--', '-std=c17', '-nostdinc++']...
# | ------------------------ clang-tidy output -----------------------
# | 4 warnings generated.
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
# |    24 |   _Bool raw_bool = 1;
# |       |                    ^
# |       |                    true
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    27 |   int i = raw_bool;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    34 |   int i = b + 1;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:13: warning: implicit conversion 'int *' -> 'bool' [readability-implicit-bool-conversion]
# |    40 |   _Bool b = p;
# |       |             ^
# |       |               != 0
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:14: note: FIX-IT applied suggested code changes
# | clang-tidy applied 4 of 4 suggested fixes.
# | 
# |    40 |   _Bool b = p;
# |       |              ^
# | 
# | ------------------------------------------------------------------
# | diff -u C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c failed:
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.760665200 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.791952900 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != 0;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------ Fixes -----------------------------
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.760665200 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.791952900 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != 0;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------------------------------------------
# | Running ['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\implicit-bool-conversion-c99.c.tmp.c', '-fix', '--checks=-*,readability-implicit-bool-conversion', '--config={}', '--', '-std=c23', '-nostdinc++']...
# | ------------------------ clang-tidy output -----------------------
# | 4 warnings generated.
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
# |    24 |   _Bool raw_bool = 1;
# |       |                    ^
# |       |                    true
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:24:20: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    27 |   int i = raw_bool;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:27:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
# |    34 |   int i = b + 1;
# |       |           ^
# |       |           (int)
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:11: note: FIX-IT applied suggested code changes
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:13: warning: implicit conversion 'int *' -> 'bool' [readability-implicit-bool-conversion]
# |    40 |   _Bool b = p;
# |       |             ^
# |       |               != nullptr
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:14: note: FIX-IT applied suggested code changes
# | clang-tidy applied 4 of 4 suggested fixes.
# | 
# |    40 |   _Bool b = p;
# |       |              ^
# | 
# | ------------------------------------------------------------------
# | diff -u C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c failed:
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.860761000 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.892009200 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != nullptr;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------ Fixes -----------------------------
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.orig	2025-12-29 01:43:55.860761000 +0000
# | +++ C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c	2025-12-29 01:43:55.892009200 +0000
# | @@ -21,23 +21,23 @@
# |  }
# | 
# |  
# | 
# |  void test_c99_native_keyword(void) {
# | 
# | -  _Bool raw_bool = 1;
# | 
# | +  _Bool raw_bool = true;
# | 
# |    //
# | 
# |    //
# | 
# | -  int i = raw_bool;
# | 
# | +  int i = (int)raw_bool;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_macro_behavior(void) {
# | 
# |    _Bool b = true;
# | 
# | -  int i = b + 1;
# | 
# | +  int i = (int)b + 1;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# |  
# | 
# |  void test_c99_pointer_conversion(int *p) {
# | 
# | -  _Bool b = p;
# | 
# | +  _Bool b = p != nullptr;
# | 
# |    //
# | 
# |    //
# | 
# |  }
# | 
# | 
# | ------------------------------------------------------------------
# | FileCheck --input-file=C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\implicit-bool-conversion-c99.c --check-prefixes=CHECK-FIXES --match-full-lines failed:
# | C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\implicit-bool-conversion-c99.c:42:18: error: CHECK-FIXES: expected string not found in input
# | 
# |  // CHECK-FIXES: _Bool b = p != 0;
# | 
# |                  ^
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:34:21: note: scanning from here
# | 
# |  int i = (int)b + 1;
# | 
# |                     ^
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c:40:2: note: possible intended match here
# | 
# |  _Bool b = p != nullptr;
# | 
# |  ^
# | 
# | 
# | 
# | Input file: C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\readability\Output\implicit-bool-conversion-c99.c.tmp.c
# | 
# | Check file: C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\readability\implicit-bool-conversion-c99.c
# | 
# | 
# | 
# | -dump-input=help explains the following input dump.
# | 
# | 
# | 
# | Input was:
# | 
# | <<<<<<
# | 
# |             .
# | 
# |             .
# | 
# |             .
# | 
# |            29:  // 
# | 
# |            30: } 
# | 
# |            31:  
# | 
# |            32: void test_c99_macro_behavior(void) { 
# | 
# |            33:  _Bool b = true; 
# | 
# |            34:  int i = (int)b + 1; 
# | 
# | check:42'0                         X error: no match found
# | 
# |            35:  // 
# | 
# | check:42'0     ~~~~
# | 
# |            36:  // 
# | 
# | check:42'0     ~~~~
# | 
# |            37: } 
# | 
# | check:42'0     ~~
# | 
# |            38:  
# | 
# | check:42'0     ~
# | 
# |            39: void test_c99_pointer_conversion(int *p) { 
# | 
# | check:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 
# |            40:  _Bool b = p != nullptr; 
# | 
# | check:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
# | 
# | check:42'1      ?                        possible intended match
# | 
# |            41:  // 
# | 
# | check:42'0     ~~~~
# | 
# |            42:  // 
# | 
# | check:42'0     ~~~~
# | 
# |            43: } 
# | 
# | check:42'0     ~~
# | 
# | >>>>>>
# | 
# | 
# `-----------------------------
# .---command stderr------------
# | Traceback (most recent call last):
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 413, in <module>
# |     main()
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 409, in main
# |     CheckRunner(args, extra_args).run()
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 311, in run
# |     self.check_fixes()
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 255, in check_fixes
# |     try_run(
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 63, in try_run
# |     process_output = subprocess.check_output(args, stderr=subprocess.STDOUT).decode(
# |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |   File "c:\python312\Lib\subprocess.py", line 466, in check_output
# |     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
# |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |   File "c:\python312\Lib\subprocess.py", line 571, in run
# |     raise CalledProcessError(retcode, process.args,
# | subprocess.CalledProcessError: Command '['FileCheck', '--input-file=C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\readability\\Output\\implicit-bool-conversion-c99.c.tmp.c', 'C:\\_work\\llvm-project\\llvm-project\\clang-tools-extra\\test\\clang-tidy\\checkers\\readability\\implicit-bool-conversion-c99.c', '--check-prefixes=CHECK-FIXES', '--match-full-lines']' returned non-zero exit status 1.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/171070


More information about the cfe-commits mailing list