Repository navigation
Conversation
|
as I understand it this is a AI generated fix. I fear I don't want to invest the time to review this. |
|
Can you please respond how the code is written. By hand/by AI? I would like that checkers and other code in cppcheck are written carefully by hand.
I can envision to have AI-generated code in stuff that we don't release for instance AI generated tests. But I would appreciate if you are clear about what is AI generated. |
|
Test results for commit f198ea5 (tools/test-my-pr.py, main compared to this PR): Test: http://ec2-16-170-140-253.eu-north-1.compute.amazonaws.com/pr-8893/ Posted automatically by the cppcheck PR test runner. +N: warnings only with this PR, -N: warnings only with main. The AI review is written by Claude and can be wrong. |
Addresses Trac 4651. Boost.Assign expressions such as
values += 2, 2can perform useful work through an overloaded comma, but currently receiveconstStatementeven in ordinary warning mode.Require evidence of built-in operand types before treating a C++ comma expression as a constant statement. Account for assignment overloads separately: their inferred type is copied from the lhs, while the declared operator may return a different type. Conservatively inspect available return types without selecting an arbitrary overload; unknown, inherited, template and user-defined-conversion cases remain uncertain.
Keep warnings for ordinary scalar, pointer and C comma expressions, plus declared integer/pointer/void operator results. Add three test methods covering the original numeric/string-list use, member and free operators, chained commas, enums, anonymous namespaces, template ADL, mixed overloads and a ref-qualified/user-conversion regression. No Boost-name special case or library configuration change.
Validation:
git diff --checkpass.Two earlier Windows runs exited with
0xc0000005while displayingTestIO::testPrintfArgumentVariables, whose checker does not invoke the new helper. The recorded offsets resolve to the unchangedToken::Match; neither a patch nor baseline cause is established. A bounded debugger run passed that location but was stopped after becoming slow in the existingTestValueFlow::valueFlowHang. The final complete native pass above includes the conversion regression.This is conservative classification, not complete overload resolution: uncertain class expressions can suppress a genuine warning. The primitive/pointer/void controls limit that tradeoff and preserve the demonstrated existing diagnostics.
Please assign Trac 4651 to KiritoYG for this patch and confirm eligibility under the published USD 30 bounty bracket. After qualifying closure, I can use the documented bounty-request process; please also confirm the available settlement channel.