Issue 56689
Summary modernize-use-transparent-functors not being fixed
Labels new issue
Assignees
Reporter sweemer
    The `modernize-use-transparent-functors` check [offers a fix](https://clang.llvm.org/extra/clang-tidy/checks/list.html), and while clang-tidy correctly warns about this check, it does not actually appear to be fixing it for me.

As you can see in the example below, only the `modernize-use-trailing-return-type` check is actually being fixed. Why isn't `modernize-use-transparent-functors` being fixed as well?

```
$ clang-tidy-15 --version
Ubuntu LLVM version 15.0.0

  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: skylake
```
```
$ cat test.cpp
#include <functional>
int main() {
  std::plus<int>{}(1, 1);
}
```
```
$ clang-tidy-15 -checks=modernize-* -fix test.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "test.cpp"
No compilation database found in /home/sweemer/test or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
1124 warnings generated.
/home/sweemer/test/test.cpp:2:5: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
int main() {
~~~ ^
auto       -> int
/home/sweemer/test/test.cpp:2:1: note: FIX-IT applied suggested code changes
int main() {
^
/home/sweemer/test/test.cpp:2:11: note: FIX-IT applied suggested code changes
int main() {
          ^
/home/sweemer/test/test.cpp:3:3: warning: prefer transparent functors 'plus<>' [modernize-use-transparent-functors]
  std::plus<int>{}(1, 1);
  ^
clang-tidy applied 2 of 2 suggested fixes.
Suppressed 1122 warnings (1122 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
```
```
$ cat test.cpp
#include <functional>
auto main() -> int {
  std::plus<int>{}(1, 1);
}
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to