[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

Lounarok via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 1 17:26:49 PST 2022


Lounarok added a comment.

I tried this patch and it's really helpful!

However I found that it warns when it comes to `constexpr static` variable.

Snippet: `constexpr static int UNDEFINED_ERROR{0};`
Warning msg: `warning: global constant 'UNDEFINED_ERROR' should be marked as 'inline' [modernize-use-inline-const-variables-in-headers]`
According to this <https://en.cppreference.com/w/cpp/language/constexpr>,  "A constexpr specifier used in a function or static data member (since C++17) declaration implies inline."

Just a notification up here, I'm fine with `// constexpr implies inline, just ignore inline const warning
// NOLINTNEXTLINE(modernize-use-inline-const-variables-in-headers)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118743/new/

https://reviews.llvm.org/D118743



More information about the cfe-commits mailing list