[clang-tools-extra] [clang-tidy] New option `CompilationArgsToRemoveRegex` to remove arguments from the command line (PR #111453)

Félix-Antoine Constantin via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 3 14:24:59 PDT 2025


felix642 wrote:

@kwalker-plxs 
Please have a look at other contributor's concerns on this PR. The main issue was that setting up this option would be non-trivial and might get pretty complicated if they are multiple flags that we need to remove. It might also remove some unexpected arguments without the user noticing and impact the quality of the clang-tidy's inspection if not setup properly. 

In my opinion, and after reading this PR's comments, a better approach would be to add an option to downgrade the errors clang-tidy currently emits when it doesn't recognize a compilation flag. That way the user could downgrade the errors to warnings if they want to have a feedback on which arguments were ignored or completely ignore them if they don't care.

This would be much easier to maintain from a user's perspective since a change to the GCC compilation wouldn't impact the clang-tidy analysis.

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


More information about the cfe-commits mailing list