[clang-tools-extra] [clang-tidy][docs] improve documentation on cppcoreguidelines-narrowing-conversions (#111510) (PR #118209)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 2 14:30:52 PST 2024
================
@@ -27,6 +27,39 @@ This check will flag:
- All applications of binary operators with a narrowing conversions.
For example: ``int i; i+= 0.1;``.
+Arithmetic with smaller integer types than ``int`` trigger implicit conversions,
+as explained under `"Integral Promotion" on cppreference.com
+<https://en.cppreference.com/w/cpp/language/implicit_conversion>`_.
+This check diagnoses more instances of narrowing than the compiler warning
+``-Wconversion`` does. The example below demonstrates this behavior.
----------------
EugeneZelenko wrote:
```suggestion
`-Wconversion` does. The example below demonstrates this behavior.
```
Not language construct.
https://github.com/llvm/llvm-project/pull/118209
More information about the cfe-commits
mailing list