[clang-tools-extra] [clang-tidy] Remove check-specific HeaderFileExtensions and Implement… (PR #80333)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 1 12:12:28 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-tidy
Author: Carlos Galvez (carlosgalvezp)
<details>
<summary>Changes</summary>
…ationFileExtensions
Deprecated since clang-tidy 17. Use the corresponding global options instead.
Fixes #<!-- -->61947
---
Patch is 35.96 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/80333.diff
23 Files Affected:
- (modified) clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp (+2-20)
- (modified) clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h (-10)
- (modified) clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp (+3-35)
- (modified) clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h (-15)
- (modified) clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp (+2-20)
- (modified) clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h (-10)
- (modified) clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp (+2-20)
- (modified) clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h (-10)
- (modified) clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp (+5-34)
- (modified) clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h (-9)
- (modified) clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp (+2-15)
- (modified) clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp (+2-20)
- (modified) clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.h (-10)
- (modified) clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp (-4)
- (modified) clang-tools-extra/clang-tidy/utils/HeaderGuard.h (+3-24)
- (modified) clang-tools-extra/docs/ReleaseNotes.rst (+31)
- (modified) clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-include.rst (-24)
- (modified) clang-tools-extra/docs/clang-tidy/checks/google/build-namespaces.rst (-15)
- (modified) clang-tools-extra/docs/clang-tidy/checks/google/global-names-in-headers.rst (-15)
- (modified) clang-tools-extra/docs/clang-tidy/checks/llvm/header-guard.rst (-15)
- (modified) clang-tools-extra/docs/clang-tidy/checks/misc/definitions-in-headers.rst (-24)
- (modified) clang-tools-extra/docs/clang-tidy/checks/misc/unused-using-decls.rst (+1-15)
- (modified) clang-tools-extra/docs/clang-tidy/checks/misc/use-anonymous-namespace.rst (+1-15)
``````````diff
diff --git a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
index 4a467120181b4..93f35cb2c1a3d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
@@ -27,26 +27,8 @@ AST_MATCHER(clang::VarDecl, hasConstantDeclaration) {
DynamicStaticInitializersCheck::DynamicStaticInitializersCheck(
StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid header file extension: '%0'")
- << RawStringHeaderFileExtensions;
- }
- } else
- HeaderFileExtensions = Context->getHeaderFileExtensions();
-}
-
-void DynamicStaticInitializersCheck::storeOptions(
- ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "HeaderFileExtensions", RawStringHeaderFileExtensions);
-}
+ : ClangTidyCheck(Name, Context),
+ HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
void DynamicStaticInitializersCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
diff --git a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
index d8ac31dc3b850..66ed2828502b6 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
@@ -15,26 +15,16 @@
namespace clang::tidy::bugprone {
/// Finds dynamically initialized static variables in header files.
-///
-/// The check supports these options:
-/// - `HeaderFileExtensions`: a semicolon-separated list of filename
-/// extensions of header files (The filename extensions should not contain
-/// "." prefix). ";h;hh;hpp;hxx" by default.
-//
-/// For extension-less header files, using an empty string or leaving an
-/// empty string between ";" if there are other filename extensions.
class DynamicStaticInitializersCheck : public ClangTidyCheck {
public:
DynamicStaticInitializersCheck(StringRef Name, ClangTidyContext *Context);
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.CPlusPlus && !LangOpts.ThreadsafeStatics;
}
- void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
- StringRef RawStringHeaderFileExtensions;
FileExtensionsSet HeaderFileExtensions;
};
diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
index 43d53f0b6020a..61d89cf308130 100644
--- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
@@ -37,41 +37,9 @@ class SuspiciousIncludePPCallbacks : public PPCallbacks {
SuspiciousIncludeCheck::SuspiciousIncludeCheck(StringRef Name,
ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {
- std::optional<StringRef> ImplementationFileExtensionsOption =
- Options.get("ImplementationFileExtensions");
- RawStringImplementationFileExtensions =
- ImplementationFileExtensionsOption.value_or(
- utils::defaultImplementationFileExtensions());
- if (ImplementationFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringImplementationFileExtensions,
- ImplementationFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid implementation file extension: '%0'")
- << RawStringImplementationFileExtensions;
- }
- } else
- ImplementationFileExtensions = Context->getImplementationFileExtensions();
-
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid header file extension: '%0'")
- << RawStringHeaderFileExtensions;
- }
- } else
- HeaderFileExtensions = Context->getHeaderFileExtensions();
-}
-
-void SuspiciousIncludeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "ImplementationFileExtensions",
- RawStringImplementationFileExtensions);
- Options.store(Opts, "HeaderFileExtensions", RawStringHeaderFileExtensions);
+ : ClangTidyCheck(Name, Context),
+ HeaderFileExtensions(Context->getHeaderFileExtensions()),
+ ImplementationFileExtensions(Context->getImplementationFileExtensions()) {
}
void SuspiciousIncludeCheck::registerPPCallbacks(
diff --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h
index 0cc1639678a28..1167b5a4593f7 100644
--- a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h
@@ -21,16 +21,6 @@ namespace clang::tidy::bugprone {
/// #include "bar.c" // warning
/// #include "baz.h" // no diagnostic
///
-/// The check supports these options:
-/// - `HeaderFileExtensions`: a semicolon-separated list of filename
-/// extensions of header files (The filename extensions should not contain
-/// "." prefix) ";h;hh;hpp;hxx" by default. For extension-less header
-/// files, using an empty string or leaving an empty string between ";" if
-/// there are other filename extensions.
-///
-/// - `ImplementationFileExtensions`: likewise, a semicolon-separated list of
-/// filename extensions of implementation files. "c;cc;cpp;cxx" by default.
-///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-include.html
class SuspiciousIncludeCheck : public ClangTidyCheck {
@@ -38,14 +28,9 @@ class SuspiciousIncludeCheck : public ClangTidyCheck {
SuspiciousIncludeCheck(StringRef Name, ClangTidyContext *Context);
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
Preprocessor *ModuleExpanderPP) override;
- void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
FileExtensionsSet HeaderFileExtensions;
FileExtensionsSet ImplementationFileExtensions;
-
-private:
- StringRef RawStringHeaderFileExtensions;
- StringRef RawStringImplementationFileExtensions;
};
} // namespace clang::tidy::bugprone
diff --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
index 59031b4e1eec5..d40b4c1a1c3f7 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
@@ -18,26 +18,8 @@ namespace clang::tidy::google::readability {
GlobalNamesInHeadersCheck::GlobalNamesInHeadersCheck(StringRef Name,
ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid header file extension: '%0'")
- << RawStringHeaderFileExtensions;
- }
- } else
- HeaderFileExtensions = Context->getHeaderFileExtensions();
-}
-
-void GlobalNamesInHeadersCheck::storeOptions(
- ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "HeaderFileExtensions", RawStringHeaderFileExtensions);
-}
+ : ClangTidyCheck(Name, Context),
+ HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
void GlobalNamesInHeadersCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
diff --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
index 625a1918fef16..70a0a4c0cda00 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
@@ -17,25 +17,15 @@ namespace clang::tidy::google::readability {
/// Flag global namespace pollution in header files.
/// Right now it only triggers on using declarations and directives.
///
-/// The check supports these options:
-/// - `HeaderFileExtensions`: a semicolon-separated list of filename
-/// extensions of header files (the filename extensions should not contain
-/// "." prefix). ";h;hh;hpp;hxx" by default.
-///
-/// For extension-less header files, using an empty string or leaving an
-/// empty string between ";" if there are other filename extensions.
-///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/google/global-names-in-headers.html
class GlobalNamesInHeadersCheck : public ClangTidyCheck {
public:
GlobalNamesInHeadersCheck(StringRef Name, ClangTidyContext *Context);
- void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
- StringRef RawStringHeaderFileExtensions;
FileExtensionsSet HeaderFileExtensions;
};
diff --git a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
index 59766a1a3fd48..34ddd7623bf5e 100644
--- a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
@@ -17,26 +17,8 @@ namespace clang::tidy::google::build {
UnnamedNamespaceInHeaderCheck::UnnamedNamespaceInHeaderCheck(
StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid header file extension: '%0'")
- << RawStringHeaderFileExtensions;
- }
- } else
- HeaderFileExtensions = Context->getHeaderFileExtensions();
-}
-
-void UnnamedNamespaceInHeaderCheck::storeOptions(
- ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "HeaderFileExtensions", RawStringHeaderFileExtensions);
-}
+ : ClangTidyCheck(Name, Context),
+ HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
void UnnamedNamespaceInHeaderCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
diff --git a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
index 8a16e750385fd..55b735c0d141b 100644
--- a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
+++ b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
@@ -16,14 +16,6 @@ namespace clang::tidy::google::build {
/// Finds anonymous namespaces in headers.
///
-/// The check supports these options:
-/// - `HeaderFileExtensions`: a semicolon-separated list of filename
-/// extensions of header files (The filename extensions should not contain
-/// "." prefix). ";h;hh;hpp;hxx" by default.
-///
-/// For extension-less header files, using an empty string or leaving an
-/// empty string between ";" if there are other filename extensions.
-///
/// https://google.github.io/styleguide/cppguide.html#Namespaces
///
/// Corresponding cpplint.py check name: 'build/namespaces'.
@@ -36,12 +28,10 @@ class UnnamedNamespaceInHeaderCheck : public ClangTidyCheck {
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.CPlusPlus;
}
- void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
- StringRef RawStringHeaderFileExtensions;
FileExtensionsSet HeaderFileExtensions;
};
diff --git a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
index 2c07b30429f96..21008bc144b91 100644
--- a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
@@ -28,45 +28,16 @@ AST_MATCHER_P(NamedDecl, usesHeaderFileExtension, FileExtensionsSet,
DefinitionsInHeadersCheck::DefinitionsInHeadersCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
- UseHeaderFileExtension(Options.get("UseHeaderFileExtension", true)) {
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid header file extension: '%0'")
- << RawStringHeaderFileExtensions;
- }
- } else
- HeaderFileExtensions = Context->getHeaderFileExtensions();
-}
-
-void DefinitionsInHeadersCheck::storeOptions(
- ClangTidyOptions::OptionMap &Opts) {
- Options.store(Opts, "UseHeaderFileExtension", UseHeaderFileExtension);
- Options.store(Opts, "HeaderFileExtensions", RawStringHeaderFileExtensions);
-}
+ HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
void DefinitionsInHeadersCheck::registerMatchers(MatchFinder *Finder) {
auto DefinitionMatcher =
anyOf(functionDecl(isDefinition(), unless(isDeleted())),
varDecl(isDefinition()));
- if (UseHeaderFileExtension) {
- Finder->addMatcher(namedDecl(DefinitionMatcher,
- usesHeaderFileExtension(HeaderFileExtensions))
- .bind("name-decl"),
- this);
- } else {
- Finder->addMatcher(
- namedDecl(DefinitionMatcher,
- anyOf(usesHeaderFileExtension(HeaderFileExtensions),
- unless(isExpansionInMainFile())))
- .bind("name-decl"),
- this);
- }
+ Finder->addMatcher(namedDecl(DefinitionMatcher,
+ usesHeaderFileExtension(HeaderFileExtensions))
+ .bind("name-decl"),
+ this);
}
void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h
index e0095494d339b..ebb55d5c0e55b 100644
--- a/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h
@@ -20,12 +20,6 @@ namespace clang::tidy::misc {
/// The check supports these options:
/// - `UseHeaderFileExtension`: Whether to use file extension to distinguish
/// header files. True by default.
-/// - `HeaderFileExtensions`: a semicolon-separated list of filename
-/// extensions of header files (The filename extension should not contain
-/// "." prefix). ";h;hh;hpp;hxx" by default.
-///
-/// For extension-less header files, using an empty string or leaving an
-/// empty string between ";" if there are other filename extensions.
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/misc/definitions-in-headers.html
@@ -35,13 +29,10 @@ class DefinitionsInHeadersCheck : public ClangTidyCheck {
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
return LangOpts.CPlusPlus11;
}
- void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
private:
- const bool UseHeaderFileExtension;
- StringRef RawStringHeaderFileExtensions;
FileExtensionsSet HeaderFileExtensions;
};
diff --git a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
index 59e487bab3119..90b317527ee41 100644
--- a/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.cpp
@@ -39,21 +39,8 @@ static bool shouldCheckDecl(const Decl *TargetDecl) {
UnusedUsingDeclsCheck::UnusedUsingDeclsCheck(StringRef Name,
ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->configurationDiag("Invalid header file extension: '%0'")
- << RawStringHeaderFileExtensions;
- }
- } else
- HeaderFileExtensions = Context->getHeaderFileExtensions();
-}
+ : ClangTidyCheck(Name, Context),
+ HeaderFileExtensions(Context->getHeaderFileExtensions()) {}
void UnusedUsingDeclsCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(usingDecl(isExpansionInMainFile()).bind("using"), this);
diff --git a/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp b/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp
index a6337f5bab834..05b470141f1f7 100644
--- a/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/UseAnonymousNamespaceCheck.cpp
@@ -31,26 +31,8 @@ AST_MATCHER(VarDecl, isStaticDataMember) { return Node.isStaticDataMember(); }
UseAnonymousNamespaceCheck::UseAnonymousNamespaceCheck(
StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {
- std::optional<StringRef> HeaderFileExtensionsOption =
- Options.get("HeaderFileExtensions");
- RawStringHeaderFileExtensions =
- HeaderFileExtensionsOption.value_or(utils::defaultHeaderFileExtensions());
- if (HeaderFileExtensionsOption) {
- if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
- HeaderFileExtensions,
- utils::defaultFileExtensionDelimiters())) {
- this->con...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/80333
More information about the cfe-commits
mailing list