[clang-tools-extra] [clang-tidy][docs] improve documentation on cppcoreguidelines-narrowing-conversions (#111510) (PR #118209)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 1 10:25:51 PST 2024


================
@@ -27,6 +27,29 @@ This check will flag:
  - All applications of binary operators with a narrowing conversions.
    For example: ``int i; i+= 0.1;``.
 
+Note that arithmetic with integer types may perform implicit conversions if the used integer types are smaller than ``int``.
+These rules are documented under `"Integral Promotion" on this cppreference.com <https://en.cppreference.com/w/cpp/language/implicit_conversion>`_
+page. The following example demonstrates this behavior and can be explored with `cppinsights.io <https://cppinsights.io/s/68553908>`_.
----------------
PiotrZSL wrote:

Dont put links to cppinsights, proper example is already bellow

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


More information about the cfe-commits mailing list