clang-tidy.yml: updated to Clang 21#421
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.
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.
This is not semantically const. Maybe a NOLINT would be more appropriate.
There was a problem hiding this comment.
Indeed.
Maybe I should apply danmar/cppcheck#4785 to simplecpp first.
| 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.
Same, B's members are modified below.
Looks like there still is a cppcheck FN here.
There was a problem hiding this comment.
That's possible. I did not check all remaining cases yet.
There was a problem hiding this comment.
There's several false negatives.
There was a problem hiding this comment.
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.
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.
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.
This is also only technically correct.
|
I validated the |
danmar
left a comment
There was a problem hiding this comment.
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 |
simplecpp.cpp
Outdated
| } | ||
| } | ||
|
|
||
| // NOLINTNEXTLINE(misc-const-correctness) - technically correct but used to access non-cost data |
|
Are there any plans for a new simplecpp version? |
From my side after #475 was merged. |
No description provided.