You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To reproduce
Run clang-tidy on any file containing BENCHMARK macro, with the misc-use-anonymous-namespace check enabled
Expected behavior
No warning is emitted (warning should be suppressed)
Screenshots
Additional context:
This can be fixed by adding NOLINTNEXTLINE(misc-use-anonymous-namespace) within the macro declaration. Adding this silences the warning, only for BENCHMARK statement itself.
Disables 'misc-use-anonymous-namespace' for usage of the BENCHMARK
macro. This warning is spurious, and the variable declared by the
BENCHMARK macro can't be moved into an annonymous namespace.
We don't want to disable it globally, but it can be disabled locally,
for the `BENCHMARK` statement, as this warning appears downstream for
users.
See:
https://clang.llvm.org/extra/clang-tidy/#suppressing-undesired-diagnostics
Disables 'misc-use-anonymous-namespace' for usage of the BENCHMARK
macro. This warning is spurious, and the variable declared by the
BENCHMARK macro can't be moved into an annonymous namespace.
We don't want to disable it globally, but it can be disabled locally,
for the `BENCHMARK` statement, as this warning appears downstream for
users.
See:
https://clang.llvm.org/extra/clang-tidy/#suppressing-undesired-diagnostics
Describe the bug
Use of the
BENCHMARK
macro results in a clang-tidy warning, because the macro expands to a global variable declared withstatic
.To reproduce
Run clang-tidy on any file containing
BENCHMARK
macro, with themisc-use-anonymous-namespace
check enabledExpected behavior
No warning is emitted (warning should be suppressed)
Screenshots
Additional context:
This can be fixed by adding
NOLINTNEXTLINE(misc-use-anonymous-namespace)
within the macro declaration. Adding this silences the warning, only forBENCHMARK
statement itself.The text was updated successfully, but these errors were encountered: