================ @@ -311,7 +311,12 @@ ClangTidyDiagnosticConsumer::ClangTidyDiagnosticConsumer( : Context(Ctx), ExternalDiagEngine(ExternalDiagEngine), RemoveIncompatibleErrors(RemoveIncompatibleErrors), GetFixesFromNotes(GetFixesFromNotes), - EnableNolintBlocks(EnableNolintBlocks) {} + EnableNolintBlocks(EnableNolintBlocks) { + + if (Context.getOptions().ExcludeHeaderFilterRegex) + ExcludeHeaderFilter = std::make_unique<llvm::Regex>( + *Context.getOptions().ExcludeHeaderFilterRegex); +} ---------------- 5chmidti wrote:
It's not a good idea to have basically the same thing implemented in two different ways (`HeaderFilter` vs `ExcludeHeaderFilter`). I think the `ExcludeHeaderFilter` should be implemented like the `HeaderFilter`. https://github.com/llvm/llvm-project/blob/dcf92a249233cab103f848dd12e96e0d642a8899/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp#L574-L579 This would also solve @PiotrZSL's comment. We can probably save the constructions of `llvm::Regex` and the call to `match` on the empty regex. wdyt? This could also be done in another pr. https://github.com/llvm/llvm-project/pull/91400 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits