Issue 128510
Summary [clang-tidy] narrowing conversion should highlight the last function name in the call chain
Labels clang-tidy
Assignees
Reporter maxim-banaev
    In this example, `size()` should be highlighted instead of `vec`.

```
#include <vector>

int main()
{
    std::vector<int> vec{1, 2, 3};
    int a = vec.size();
    return 0;
}
```

clang-tidy output:
```
clang-tidy main.cpp -checks="-*,*-narrowing-conversions"
.../main.cpp:6:13: warning: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
 6 |     int a = vec.size();
      |             ^
```

clang-tidy version is 21.0.0
llvm-project revision: 2b71df5a74cb5bd67f3f34277749dc920fd35105
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to