[clang-tools-extra] [clang-tidy] Fix false positive in bugprone-dynamic-static-initializers (PR #174275)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 3 07:05:09 PST 2026


================
@@ -18,12 +18,11 @@ namespace clang::tidy::bugprone {
 namespace {
 
 AST_MATCHER(clang::VarDecl, hasConstantDeclaration) {
+  if (Node.isConstexpr())
+    return true;
----------------
zeyi2 wrote:

A follow up TODO could be: add `constinit` support (>= C++20) for this check.

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


More information about the cfe-commits mailing list