Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
None
Purpose of change
More static analysis. These three checks look for use of reserved identifiers.
Describe the solution
There are three clang-tidy checks which are looking for use of reserved identifiers. Enable all of them and fix or suppress the associated warnings.
The reserved identifiers we had fall into three categories:
__
_
followed by a capital letter._
in the global namespace.Most of those could be automatically fixed by clang-tidy.
One was also affected by the
cata-static-string_id-constants
check, which needed to be updated so they wouldn't conflict.Two cases were erroneous (looks like a
clang-tidy
bug because it was reporting the wrong identifiers) and needed suppression._USE_MATH_DEFINES
is an intentional definition of a library macro, and needed suppression.The
_
macro we use for translation is a reserved identifier, but we're going to use it anyway. So that is also suppressed.Describe alternatives you've considered
Not worrying about these names.
Looking into the buggy reports more carefully to see what was up with them.
Testing
There's a small chance this change has introduced a name collision and thus some bug, but I think that probably would have led to a compiler error.
Additional context