AI review of 2026-11-03_21-35-30-b599e414d4df-results.txt PR: #8979 https://github.com/cppcheck-opensource/cppcheck/pull/8979 Tested: b599e414d4dffc7943fa64c7b873f709b41cef4c Merge base: ebadd92589da0f08005d304497d856604906a8ea Reviewed: 2026-11-04 17:18:11 UTC Model: claude-opus-5-5 (effort high) Results: 6 reviewed of 6 in the report Verdicts: 1 acceptable regression, 5 improvement Tokens: 9635 input, 10345 cache read, 2069 cache write, 2658 output The verdicts are written by AI and can be wrong. ---- 1 / 6 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/cura-engine/cura-engine_5.0.0.orig.tar.gz Result: main CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:74:26: error: Returning object that points to local variable 'after' that will be invalid when returning. [returnDanglingLifetime] CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:73:27: note: Assigned to reference. CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:74:27: note: Passed to constructor of 'ListPolyIt'. CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:61:90: note: Variable created here. CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:74:26: note: Returning object that points to local variable 'after' that will be invalid when returning. Explanation: `after.poly` is a pointer member of ListPolyIt (`ListPolygon* poly`). `*after.poly` dereferences that pointer, so the reference `poly` refers to an external ListPolygon, not to storage inside the local parameter `after`. Returning a ListPolyIt built from it does not dangle. The PR's checkDotLifetime stops treating `*x.member` as a lifetime of `x` unless the member is an array. That removes this false positive. ---- 2 / 6 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/f/fastnetmon/fastnetmon_1.2.9.orig.tar.gz Result: main pavel-odintsov-fastnetmon-394fbe0/src/fmt/base.h:508:10: error: Reference to temporary returned. [returnTempReference] Explanation: `*accessor(it).container` dereferences the `container` pointer member of a temporary (in std::back_insert_iterator, `container` is a pointer). The returned reference points to the external container, not to the temporary, so the old returnTempReference warning was a false positive. The PR only treats `*x.member` as pointing into x when the member is an array, which removes this warning correctly. ---- 3 / 6 ---- Verdict: ACCEPTABLE REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kf6-syntax-highlighting/kf6-syntax-highlighting_6.30.0.orig.tar.xz Result: main syntax-highlighting-6.30.0/src/indexer/katehighlightingindexer.cpp:2224:20: style: Variable 'observedRule' can be declared as reference to const [constVariableReference] Explanation: In the loop `for (auto &observedRule : observedRules)`, `observedRule` is only read in the code shown: `*observedRule.rule` dereferences a pointer member, and the rest of the visible loop uses `rule`. So `const auto &` would work, and the main warning is very likely a true positive. The PR changes lifetime tracking for `*x.member` when the member is not an array. `rule` no longer gets its lifetime from `observedRule`, which is semantically more correct, but it seems to make the constness analysis more conservative. The result is that this valid style suggestion is lost: a new false negative, not a new false positive. The full loop body is not shown, so a later write to `observedRule` cannot be ruled out. ---- 4 / 6 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/pdal/pdal_2.2.0+ds.orig.tar.xz Result: main PDAL-2.2.0/vendor/pdalboost/libs/serialization/src/basic_oarchive.cpp:231:12: error: Reference to local variable returned. [returnReference] Explanation: `cresult` is a `std::pair`, so `cresult.first` is a set iterator. Dereferencing it gives a reference to an element stored in the member `cobject_info_set`, not a reference to the local pair. Returning `*(cresult.first)` is therefore safe and the old returnReference warning was a false positive. The PR now only follows `.` through `*` when the member is an array, so the iterator member no longer counts as part of the local's lifetime. ---- 5 / 6 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/p/pdal/pdal_2.2.0+ds.orig.tar.xz Result: main PDAL-2.2.0/vendor/pdalboost/libs/serialization/src/basic_oarchive.cpp:241:12: error: Reference to local variable returned. [returnReference] Explanation: `result.first` is a set iterator, and `*(result.first)` dereferences it to get a reference to an element stored in the member `cobject_info_set`. It is not a reference to the local `result`. Main treated `*result.first` as referring to the local variable, which was a false positive. The PR stops this unless the dereferenced member is an array, so the warning goes away correctly. ---- 6 / 6 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/sumo/sumo_1.27.1+dfsg.orig.tar.xz Result: your sumo-1_27_1/src/netimport/NIImporter_OpenDrive.cpp:1737:104: style: Parameter 'edges' can be declared as reference to const [constParameterReference] Explanation: `edges` is a map of `OpenDriveEdge*`. The loop takes `const auto& i` and writes only through `*i.second`, i.e. to the pointed-to edge, not to the map. Before the PR, the lifetime of `*i.second` was traced back to `i` and therefore to `edges`. Writes through `e` then counted as modifying the map, which suppressed the warning. With the PR, dereferencing a non-array pointer member no longer inherits the container's lifetime, so Cppcheck correctly sees that the map itself is not modified. `const std::map<...>&` would compile in the visible code. Confidence is medium because the end of the function is not shown, but nothing visible modifies `edges`, so this looks like a correct new true positive.