Issue 144510
Summary `modernize-use-trailing-return-type` reports underlying type in fix-it for lamdba
Labels bug, clang-tidy
Assignees
Reporter firewave
    ```cpp
#include <algorithm>
#include <cstddef>

void f()
{
    auto val = [](size_t m) {
        size_t a = 0;
        return std::max(m, a);
 };
}
```

```
<source>:6:16: warning: use a trailing return type for this lambda [modernize-use-trailing-return-type]
    6 |     auto val = [](size_t m) {
      |                ^
      | -> unsigned long
```

https://godbolt.org/z/9K4M7Mz8E

It should be reporting `size_t` instead. It seems to be related to the template call involved.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to