Issue 179386
Summary clang-tidy 22 regression: modernize-type-traits incorrectly diagnoses captured structured bindings
Labels clang-tidy, regression:22
Assignees
Reporter vogelsgesang
    Running `clang-tidy -checks=modernize-type-traits input.cpp -- clang -std=c++23` on

```cpp
#include <utility>
using namespace std;

pair<int, int> getPair() { return make_pair(1,2); }

int test() {
   auto [a, b] = getPair();
   auto myLambda = [&]() {
      return a*2;
   };
   return myLambda();
}
```

diagnoses

```
input.cpp:9:14: warning: use c++14 style type templates [modernize-type-traits]
    9 |       return a*2 + b;
 |              ^
      |              _t
```

which is obviously incorrect.

This (or rather the non-minified repro) used to work in clang-tidy 21. Seems to be a regression in clang-tidy-22
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to