-
Notifications
You must be signed in to change notification settings - Fork 94
clang-tidy.yml: updated to Clang 21 #421
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
Conversation
db52506 to
7babd3f
Compare
|
|
The root cause of this issue seems to be that I think the cleanest solution to this is to replace the references with pointers and implement sane move operators. I'll work out a draft. @danmar please chime in if you have an opinion on this. |
|
Related: #493 |
|
I filed https://trac.cppcheck.net/ticket/14119 about detecting one of the |
|
I worked around the |
| // NOLINTNEXTLINE(misc-const-correctness) - FP | ||
| FileData *const newdata = new FileData(std::move(data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed llvm/llvm-project#157730 about this.
|
Can this be merged? It is blocking danmar/cppcheck#7807 |
simplecpp.cpp
Outdated
| } | ||
|
|
||
| Token * const output_end_1 = output.back(); | ||
| const Token * const output_end_1 = output.back(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not semantically const. Maybe a NOLINT would be more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.
Maybe I should apply danmar/cppcheck#4785 to simplecpp first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| const bool unexpectedA = (!A->name && !A->number && !A->str().empty() && !canBeConcatenatedWithEqual && !canBeConcatenatedStringOrChar); | ||
|
|
||
| Token * const B = tok->next->next; | ||
| const Token * const B = tok->next->next; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, B's members are modified below.
Looks like there still is a cppcheck FN here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's possible. I did not check all remaining cases yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's several false negatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as https://trac.cppcheck.net/ticket/14161.
|
Ping @danmar |
|
|
||
| std::string type; | ||
| for (simplecpp::Token *typeToken = tok1; typeToken != tok2; typeToken = typeToken->next) { | ||
| for (const simplecpp::Token *typeToken = tok1; typeToken != tok2; typeToken = typeToken->next) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
False negative tracked as https://trac.cppcheck.net/ticket/14119.
| if (tok->str() != "sizeof") | ||
| continue; | ||
| simplecpp::Token *tok1 = tok->next; | ||
| const simplecpp::Token *tok1 = tok->next; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed https://trac.cppcheck.net/ticket/14161 about this.
simplecpp.cpp
Outdated
| { | ||
| bool gotoTok1 = false; | ||
| for (Token *tok = *tok1; tok && tok->op != ')'; tok = gotoTok1 ? *tok1 : tok->next) { | ||
| for (const Token *tok = *tok1; tok && tok->op != ')'; tok = gotoTok1 ? *tok1 : tok->next) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also only technically correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
I validated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have spelling to complain about
simplecpp.cpp
Outdated
| void simplecpp::TokenList::constFoldQuestionOp(Token **tok1) | ||
| { | ||
| bool gotoTok1 = false; | ||
| // NOLINTNEXTLINE(misc-const-correctness) - technically correct but used to access non-cost data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"non-cost" => "non-const"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
simplecpp.cpp
Outdated
| } | ||
| } | ||
|
|
||
| // NOLINTNEXTLINE(misc-const-correctness) - technically correct but used to access non-cost data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling: "non-cost"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
Are there any plans for a new simplecpp version? |
From my side after #475 was merged. |
No description provided.