[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

Thomas Schenker via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 12 11:19:45 PDT 2025


schenker wrote:

I tested 6040ba1eed8d4fe6c573a11568c15cc66e31d4a3 and found this fixit that does not compile:

**Input**
```cpp
namespace
{
struct N
{
 [[maybe_unused]] friend void operator<<(int&, const N&) {}
};
}
```

```console
clang-tidy -checks="-*,*constexpr*" -export-fixes fixes.yaml test.cpp -- --std=c++23
```
**Result**
```cpp
namespace
{
struct N
{
  constexpr [[maybe_unused]] friend void operator<<(int&, const N&) {}
};
}
```

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


More information about the cfe-commits mailing list