-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clang-tidy not respecting -Wno-builtin-macro-redefined with gnu++20 #56709
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@llvm/issue-subscribers-clang-tidy |
Is there any workaround? This just cropped up for me when using the Bazel module for clang-tidy integration: https://github.com/erenon/bazel_clang_tidy |
Just got into this error, with the same problem using https://github.com/erenon/bazel_clang_tidy. |
This is a clang-tidy bug report (nothing to do with clang). |
Can confirm this issue: https://godbolt.org/z/ohq19e8Wq Clang silences the diagnostic and clang-tidy continues to issue it. |
Related to #61969 |
Previously, `redefining builtin macro [clang-diagnostic-builtin-macro-redefined,-warnings-as-errors]` was reported despite the existence of the `-Wno-builtin-macro-redefined` in the compiler argument. This is a known issue for older version of clang as in * llvm/llvm-project#56709 * erenon/bazel_clang_tidy#29 The workaround discussed was to explicitly add `-clang-diagnostic-builtin-macro-redefined` in the checks of clang-tidy, which can be removed after we upgrade to LLVM 17. part of #28566 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Previously, `redefining builtin macro [clang-diagnostic-builtin-macro-redefined,-warnings-as-errors]` was reported despite the existence of the `-Wno-builtin-macro-redefined` in the compiler argument. This is a known issue for older version of clang as in * llvm/llvm-project#56709 * erenon/bazel_clang_tidy#29 The workaround discussed was to explicitly add `-clang-diagnostic-builtin-macro-redefined` in the checks of clang-tidy, which can be removed after we upgrade to LLVM 17. part of #28566 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
If clang-tidy is set to use the gnu++20 language standard (does not work with regular c++ or lower versions of gnu++) then the -Wno-builtin-macro-redefined CDB flag is not respected, even if the macro is redefined as a compilation flag itself. Note that this is not an issue with the regular compiler as it does not throw that error. Minimal reproducer:
touch test.cc && llvm-project/build/bin/clang-tidy test.cc -- -std=gnu++20 -D__TIME__ -Wno-builtin-macro-redefined
The text was updated successfully, but these errors were encountered: