<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108455>108455</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Ignore unknown flags in clang-tidy
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aminya
</td>
</tr>
</table>
<pre>
Now, `cmake` has started passing gcc-specific flags for modules support, which breaks `clang-tidy`. Is there a way to tell clang-tidy to ignore the flags it doesn't understand instead of erroring out?
https://gitlab.kitware.com/cmake/cmake/-/issues/26283
```shell
FAILED: my_exe/test/CMakeFiles/my_exe_lib_tests.dir/Debug/tests.cpp.o
/opt/homebrew/Cellar/cmake/3.30.3/bin/cmake -E __run_co_compile --launcher=/opt/homebrew/bin/ccache --tidy="/Users/runner/llvm/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;--extra-arg-before=--driver-mode=g++" --source=/Users/runner/work/cpp_vcpkg_project/cpp_vcpkg_project/my_exe/test/tests.cpp -- /opt/homebrew/bin/g++-14 -DDO_NOT_USE_WMAIN -DCMAKE_INTDIR=\"Debug\" -I/Users/runner/work/cpp_vcpkg_project/cpp_vcpkg_project/my_exe/include -isystem /Users/runner/work/cpp_vcpkg_project/cpp_vcpkg_project/build/vcpkg_installed/arm64-osx/include -g -std=c++20 -arch arm64 -isysroot /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fdiagnostics-color=always -Wall -Wextra -Wextra-semi -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-cast --coverage -O0 -g -MD -MT my_exe/test/CMakeFiles/my_exe_lib_tests.dir/Debug/tests.cpp.o -MF my_exe/test/CMakeFiles/my_exe_lib_tests.dir/Debug/tests.cpp.o.d -fmodules-ts -fmodule-mapper=my_exe/test/CMakeFiles/my_exe_lib_tests.dir/Debug/tests.cpp.o.modmap -MD -fdeps-format=p1689r5 -x c++ -o my_exe/test/CMakeFiles/my_exe_lib_tests.dir/Debug/tests.cpp.o -c /Users/runner/work/cpp_vcpkg_project/cpp_vcpkg_project/my_exe/test/tests.cpp
error: unknown argument: '-fdeps-format=p1689r5' [clang-diagnostic-error]
error: unknown argument: '-fmodule-mapper=my_exe/test/CMakeFiles/my_exe_lib_tests.dir/Debug/tests.cpp.o.modmap' [clang-diagnostic-error]
error: unknown argument: '-fmodules-ts' [clang-diagnostic-error]
```
This is also related to https://github.com/clangd/clangd/issues/662
Perhaps a `remove-flag` option could solve the problem.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vl1v4joT_jXmZjRRcPhoL7hoS5Gqfduu3u2KvUOOPSQ-OHZkO1D-_ZETWrq7p0d7wZEQgcnMM1-e8SNC0JUlWrDpLZsuR6KLtfML0Wh7FKPSqeMCntyB8Ttgs1w2YkdslkMtAoQofCQFbcKwFVRSYmhJ6q2WsDWiCrB1HhqnOkMBQte2zseEdKi1rKH0JHahhzXCVhi1OrJZnsFDgFiTJxBwEEeIDiIZA2etJNKVdZ6S4smXjqAcBcv4PEJnFfkQhVWgbYgkFLgtkPfOp1BdF1mxYvmS5TfDdx1jG1hxw_iK8VWloxFlttPxIDxl0jWMr4bkz09kfKVD6CgwvuIzflV8BGSzfPiEmowZZKubh__dL1lxA81xQ68JJFKIjK_uHsWOVtr0WMPLjdHlJr0OmdKe8dWSyq46mYRMtm3m4OSLr1ybYGrXUOnpkBDJGOE_hFtkRZ4VjK9Kbd_EgPew2fjObqTbSNe02hAgGtFZWZNnxfKfoE8AUsg6afd9S5qc8dX3QD7l4DtrKbk3Zt-cbc6NLm6RXqMXKHzFiiWurcPO7qw7WD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