[clang-tools-extra] [clang-tidy][NFC] Don't store a redundant copy of `HeaderFileExtensions` in every check (PR #190302)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 2 19:48:41 PDT 2026


================
@@ -33,8 +33,7 @@ AST_MATCHER(VarDecl, hasConstantDeclaration) {
 
 DynamicStaticInitializersCheck::DynamicStaticInitializersCheck(
     StringRef Name, ClangTidyContext *Context)
-    : ClangTidyCheck(Name, Context),
-      HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
+    : ClangTidyCheck(Name, Context) {}
----------------
localspook wrote:

We usually write these trivial constructors in the header file, but this PR doesn't move them because
- it makes it a bit easier to review
-  I actually want to open a separate PR that replaces these trivial constructors with `using ClangTidyCheck::ClangTidyCheck;` in the header file, like we do here for example: https://github.com/llvm/llvm-project/blob/bc11c85b6b16f1daabfc9e8b326c9568c3318cb9/clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.h#L24-L26

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


More information about the cfe-commits mailing list