[clang-tools-extra] [clang-tidy] fix cppcoreguidelines-narrowing-conversions false positives when narrowing integer to signed integer in C++20 (PR #116591)
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 2 06:07:16 PST 2024
HerrCai0907 wrote:
It is difference level of issue. if it is an implement defined thing, it should be disabled unrelated to which coding guideline. But if it is well defined behavior, then coding guideline just a coding guideline. It even does not allow this kind of code.
```c++
short v(short a, short b) { return a + b; } // warning: narrowing conversion from 'int' to signed type 'short' is implementation-defined [cppcoreguidelines-narrowing-conversions]
```
https://github.com/llvm/llvm-project/pull/116591
More information about the cfe-commits
mailing list