<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58809>58809</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            IgnoreConversionFromTypes has no effect when set to 'long'
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jarledo
      </td>
    </tr>
</table>

<pre>
    In the following simple example clang-tidy will output a warning when the check `cppcoreguidelines-narrowing-conversions` is enabled.

```C++
int main() {
  long x = 123;
  int y = x;
}
```

```console
$ clang-tidy --checks='cppcoreguidelines-narrowing-conversions' main.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "main.cpp"
No compilation database found in /home/user/programming_test or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
2 warnings generated.
/home/user/programming_test/main.cpp:3:7: warning: Value stored to 'y' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
  int y = x;
      ^   ~
/home/user/programming_test/main.cpp:3:7: note: Value stored to 'y' during its initialization is never read
  int y = x;
      ^   ~
/home/user/programming_test/main.cpp:3:11: warning: narrowing conversion from 'long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
  int y = x;
          ^
```

This is as expected. However, if I run the same check but with `IgnoreConversionFromTypes` set to `'long'` it still outputs the same warning:

```console
$ clang-tidy --checks='cppcoreguidelines-narrowing-conversions' -config="{CheckOptions: [ {key: cppcoreguidelines-narrowing-conversions.IgnoreConversionFromTypes, value: 'long'} ]}" main.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "main.cpp"
No compilation database found in /home/user/programming_test or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
2 warnings generated.
/home/user/programming_test/main.cpp:3:7: warning: Value stored to 'y' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
  int y = x;
      ^   ~
/home/user/programming_test/main.cpp:3:7: note: Value stored to 'y' during its initialization is never read
  int y = x;
      ^   ~
/home/user/programming_test/main.cpp:3:11: warning: narrowing conversion from 'long' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
  int y = x;
          ^
```

It seems to only happen with the type `long`, if I run the same example but replace ` long x = 123;` with `size_t x = 123;` then it works to set `IgnoreConversionFromTypes` to `'size_t'`.

This is running Ubuntu 22.04 with clang-tidy installed with `apt install`:

```console
$ clang-tidy --version
Ubuntu LLVM version 14.0.0

  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: skylake
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztV01z2zgM_TXyBSONTNmWffAhtZNpdrrtzvbjmqElSGZCkxqSiq38-gUpfzWbtOm2070k44ksigQegAc8a6XLbn6twK0RKi2l3gpVgxWbRiLgjodrIbmqYyfKDrZCStCta1oHHLbcKL9_u8beRLHG4g6iSVo0TaEN1q0oUQqFNlbcmGA9LrS6R2OFVpZ2grCAiq8klkmULqP0Yv9_kvafRcTe-E9YFcrBhgsVsWnEZhDl-3UAqQnIDqJsCUOWRdnxgT_ShfXdcTXKl4-8POmakFotcb_KRueZiOMQrCXDEctfGi_LA_yE9vdWL2mXoQQKyrMznc-m0xQMLym_hd40QnJHR6Hkjq-4xSjbo1zoVpagNBWidTou0WHhnjxClTVQeQ8RY0f3jPV23uvnDrWqpOzRoau13iBdWouGLo3RteGbDYG9cWgdkHmuOmi4QUp2KQwh0abr7Vdih2V85iI-CwXO49cNBjqFE-cBA2G0bbHug6D9j1zcWrL6Ix7--Pjh_Y84-LtVPdGFWxP7oZK8tnu6skMbWKhRoeHuxOTvZY6WjvXILoi1F7lHszfov37hskWwBIVSQswgBnWeRWVrPCDhLJVIOMGleOgLSP2kkAgHBolE0fhNT1quuOwe0BBReFnoEpMlffnoDdtovPxWt0D4i8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