Skip to content
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
merged 15 commits into from
Dec 6, 2024
Merged

Conversation

alexkaratarakis
Copy link
Collaborator

No description provided.

```
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 alexkaratarakis merged commit 0298e75 into teslamotors:main Dec 6, 2024
5 checks passed
@alexkaratarakis alexkaratarakis deleted the clang-tidy-19 branch December 6, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant