-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clang tidy 19 #177
Merged
alexkaratarakis
merged 15 commits into
teslamotors:main
from
alexkaratarakis:clang-tidy-19
Dec 6, 2024
Merged
Clang tidy 19 #177
alexkaratarakis
merged 15 commits into
teslamotors:main
from
alexkaratarakis:clang-tidy-19
Dec 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
misc-include-cleaner
``` error: inital values in enum 'CustomValuesTestEnum1' are not consistent, consider explicit initialization of all, none or only the first enumerator readability-enum-initial-value,-warnings-as-errors] ```
``` error: function 'print_map_state' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage,-warnings-as-errors] ```
``` error: use '= default' to define a trivial copy-assignment operator [modernize-use-equals-default,-warnings-as-errors] ```
``` error: use designated initializer list to initialize 'Bucket' [modernize-use-designated-initializers,-warnings-as-errors] 92 | return {increment_dist(dist_and_fingerprint_), value_index_}; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
``` error: '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses,-warnings-as-errors] ```
``` error: use a ranges version of this algorithm [modernize-use-ranges,-warnings-as-errors] 1709 | var1.erase(std::remove_if(var1.begin(), var1.end(), [&](const auto&) { return true; }), | ^~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~ | std::ranges::remove_if var1 ```
``` error: 'pair' used after it was forwarded [bugprone-use-after-move,-warnings-as-errors] 21 | return container.try_emplace(std::forward<Pair>(pair).first, | ^ note: forward occurred here 22 | std::forward<Pair>(pair).second); | ^ ```
``` error: local copy 'var2' of the variable 'var1' is never modified; consider avoiding the copy performance-unnecessary-copy-initialization,-warnings-as-errors] 1951 | const MapOfInstanceCounterType var2{var1}; | ^ | & ```
Detected by clang-tidy-19's `bugprone-return-const-ref-from-parameter`
``` error: returning a constant reference parameter may cause use-after-free when the parameter is constructed from a temporary [bugprone-return-const-ref-from-parameter,-warnings-as-errors] 122 | return value; | ^~~~~ ```
alexkaratarakis
force-pushed
the
clang-tidy-19
branch
from
December 5, 2024 04:05
cc81a05
to
0298e75
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.