AI review of 2026-11-27_17-50-09-01c5ec483607-results.txt PR: #9082 https://github.com/cppcheck-opensource/cppcheck/pull/9082 Tested: 01c5ec4836075292e4328c293b4f3f61f9bdf21e Merge base: 35e76b57f7c689ec3e2a80df6e496aec53a2a48b Reviewed: 2026-11-27 21:45:06 UTC Model: claude-opus-5-5 (effort high) Results: 18 reviewed of 18 in the report Verdicts: 11 improvement, 5 regression, 2 unclear Tokens: 58670 input, 39406 cache read, 2318 cache write, 16267 output The verdicts are written by AI and can be wrong. ---- 1 / 18 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:44:14: warning: Member variable 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::cap' is not assigned a value in 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::operator='. [operatorEqVarError] Explanation: The PR fixes a bug in the template simplifier's scope trimming. `find_last_of(" :: ")` searched for any single character from that set; `rfind(" :: ")` searches for the whole separator. Because of the bug, each nesting level could cost an extra pass, so deep template chains inside a namespace were never instantiated. Now `vec::Ref>>` in namespace `Minisat` gets instantiated, and the class checks run on it. The warning is literally correct: the private `operator=` only does `assert(0); return *this;` and assigns none of `data`, `sz` or `cap`. It is the same kind of warning Cppcheck gives for this pattern on any other instantiation. The copy operations are intentionally disabled, pre-C++11 style, so users may see this as low-value noise, and it duplicates the same source line under another instantiation name. Still, it comes from Cppcheck understanding the templates better, not from a misanalysis. ---- 2 / 18 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:44:14: warning: Member variable 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::data' is not assigned a value in 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::operator='. [operatorEqVarError] Explanation: The PR fixes template scope handling, so Cppcheck now also instantiates the nested `vec::Ref>>` and checks it. The new warning sits on a private `operator=` whose body is only `assert(0); return *this;`. This is the classic pre-C++11 idiom for forbidding copies, and the comment says so explicitly ("Don't allow copying"). Not assigning `data` there is intentional and the operator is never meant to be called, so the warning is noise rather than a real bug. It is also just a duplicate of the same template code under a new instantiation name. The better template expansion is good in itself, but this particular added warning is effectively a false positive. ---- 3 / 18 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:44:14: warning: Member variable 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::sz' is not assigned a value in 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::operator='. [operatorEqVarError] Explanation: The PR fixes namespace-scope handling in the template simplifier (`find_last_of` → `rfind`), so Cppcheck now instantiates nested templates such as `vec::Ref>>`. That is a correct improvement in itself. The new warning, however, targets a private `operator=` that exists only to forbid copying, the pre-C++11 non-copyable idiom. Its body is `assert(0); return *this;`. It is meant never to be called, so not assigning `sz` is intentional. Saying the member is not assigned is literally true, but it is not a real defect and users would see it as noise. It is also a duplicate, repeated once per template instantiation. Because a likely false positive was added, this counts as a regression, though a side effect of better template understanding. ---- 4 / 18 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:44:14: warning: Member variable 'vec < vec < Watcher > >::cap' is not assigned a value in 'vec < vec < Watcher > >::operator='. [operatorEqVarError] Explanation: The PR fixes scope handling in template expansion, so Cppcheck now instantiates `vec>`. That instantiation exposes new warnings on the private `operator=` at line 44. This operator is the pre-C++11 idiom for forbidding copies: its body is `assert(0); return *this;` and it is never meant to run. Not assigning `cap` is therefore intentional, so the warning is a false positive. The new line adds noise in the template (another duplicate report on the same line) without finding a real bug, even though the underlying template fix is correct. ---- 5 / 18 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:44:14: warning: Member variable 'vec < vec < Watcher > >::data' is not assigned a value in 'vec < vec < Watcher > >::operator='. [operatorEqVarError] Explanation: The PR fixes scope handling in template expansion, so Cppcheck now instantiates nested types like `vec>`. That part is correct. But the new warning lands on the private `operator=` of Minisat's `vec`. That operator exists only to forbid copying (comment: "Don't allow copying"); its body is just `assert(0); return *this;`. It is never meant to assign members, so saying `data` is not assigned is a false positive for users. It is the same noise as on the other instantiations, now repeated for one more template instance. ---- 6 / 18 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:44:14: warning: Member variable 'vec < vec < Watcher > >::sz' is not assigned a value in 'vec < vec < Watcher > >::operator='. [operatorEqVarError] Explanation: The PR fixes scope handling in template expansion, so `vec>` is now instantiated and checked. The flagged `operator=` is a private, deliberately disabled copy assignment ("Don't allow copying"). Its body is just `assert(0); return *this;`. It is never meant to run, so saying that `sz` is not assigned is noise, not a real bug. The warning is also repeated for each new instantiation of the same template line. This is a new false positive in practice. ---- 7 / 18 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:45:14: warning: Member variable 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::cap' is not initialized in the copy constructor. [uninitMemberVarPrivate] Explanation: The PR fixes scope trimming in the template simplifier, which used find_last_of and so cut at any ':' or ' ' character. As a result, deeper nested instantiations such as vec::Ref>> are now expanded. The warning itself is technically correct: the private copy constructor `vec(vec& other) { assert(0); }` leaves data, sz and cap uninitialized. With NDEBUG the assert does nothing, so a copied object would hold garbage and the destructor would free a garbage pointer. The copy constructor is a deliberate pre-C++11 'disable copying' idiom, so the finding has little practical value. The same issue is most likely already reported for other vec instantiations, so this is consistent with existing behaviour and comes from Cppcheck understanding the templates better. ---- 8 / 18 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:45:14: warning: Member variable 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::data' is not initialized in the copy constructor. [uninitMemberVarPrivate] Explanation: The PR fixes a scope-trimming bug: `find_last_of(" :: ")` matched any single space or colon, whereas `rfind` matches the whole separator. As a result, nested template instantiations inside the `Minisat` namespace now complete within the pass limit, and `vec::Ref>>` is instantiated. The new warning is technically correct: the private copy constructor `vec(vec& other) { assert(0); }` does not initialize `data`. Cppcheck deliberately reports this case under the separate `uninitMemberVarPrivate` ID because it is a pre-C++11 non-copyable idiom. So this is the existing check's behaviour applied to a newly understood instantiation, not misanalysis. It is low-value and duplicated per instantiation, though, so its practical benefit is small. ---- 9 / 18 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:45:14: warning: Member variable 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::sz' is not initialized in the copy constructor. [uninitMemberVarPrivate] Explanation: The private copy constructor `vec(vec& other) { assert(0); }` really does leave `sz` (and `data`, `cap`) uninitialized, so the warning is technically correct. The idiom is meant to forbid copying, but in an NDEBUG build a call would produce an object with garbage members. The PR fixes scope trimming: `find_last_of` searched for single characters, while `rfind` searches for the whole " :: " string. With that fix, nested instantiations such as `vec::Ref>>` and `vec>` are now expanded. Cppcheck therefore checks these classes like any other instantiation and reports the same diagnostics. The accompanying `nextCap` unused-private-function warnings are also correct, since `capacity()` uses `imax`. This suggests the instantiations are complete, not broken. The new warnings come from better template coverage, not from a misunderstanding, although they have low practical value. ---- 10 / 18 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:45:14: warning: Member variable 'vec < vec < Watcher > >::cap' is not initialized in the copy constructor. [uninitMemberVarPrivate] Explanation: The PR fixes scope handling when instantiating templates inside a namespace. The old `find_last_of(" :: ")` treated its argument as a set of characters, whereas `rfind` searches for the whole separator string. As a result, nested instantiations such as `Minisat::vec>` are now generated and checked. The private copy constructor `vec(vec& other) { assert(0); }` really does leave `data`, `sz` and `cap` uninitialized, so the message is factually correct. Its id, `uninitMemberVarPrivate`, is the one Cppcheck uses specifically for private constructors. It is low-value, though: this is the pre-C++11 idiom for making a class non-copyable, and the constructor is never meant to run. The new line is a side effect of better template understanding rather than a misreading of the code, so it leans improvement, with low confidence because users may see it as noise. ---- 11 / 18 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:45:14: warning: Member variable 'vec < vec < Watcher > >::data' is not initialized in the copy constructor. [uninitMemberVarPrivate] Explanation: The private copy constructor `vec(vec& other) { assert(0); }` really does leave `data` (and `sz`, `cap`) uninitialized. It is an old-style 'disable copying' idiom. With NDEBUG, a call from inside the class would leave garbage that the destructor's `clear(true)` would then free. So the warning is literally correct. It appears now because the PR fixes `find_last_of(" :: ")` to `rfind(" :: ")`, so nested namespace templates like `vec>` are instantiated properly within the pass limit. The new warning comes from Cppcheck understanding the templates better, not from a false analysis. It mostly duplicates the same finding for another instantiation. ---- 12 / 18 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:45:14: warning: Member variable 'vec < vec < Watcher > >::sz' is not initialized in the copy constructor. [uninitMemberVarPrivate] Explanation: The PR fixes how the template simplifier computes the enclosing namespace scope (`rfind(" :: ")` instead of `find_last_of`). As a result, nested instantiations such as `vec>`, which Minisat really uses for its watcher occurrence lists, are now fully instantiated. The private copy constructor `vec(vec& other) { assert(0); }` has a body that does not initialize `data`, `sz` or `cap`, so the warning is factually correct. It matches what Cppcheck reports for this class template in general, and the uninitMemberVarPrivate id exists for exactly this private-constructor case. The constructor is a deliberate 'disallow copying' idiom and is never meant to run, so the practical value is small. Still, the warning comes from Cppcheck understanding the templates better, not from a misparse. ---- 13 / 18 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:50:24: style: Unused private function: 'vec < vec < RegionAllocator < uint32_t > :: Ref > >::nextCap' [unusedPrivateFunction] Explanation: The PR fixes the scope-stripping bug (`find_last_of` vs `rfind`), so Cppcheck now correctly instantiates the nested `vec::Ref>>` in namespace Minisat. In this Minisat Vec.h, the private static `nextCap` is defined but never called. `capacity()` computes the growth inline with `imax`, and the other copy of `nextCap` is commented out. So the unusedPrivateFunction warning is a true positive, and it shows up because Cppcheck now understands the template better. It may be somewhat redundant with warnings for other instantiations. ---- 14 / 18 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/berkeley-abc/berkeley-abc_1.01+20221019git70cb339+dfsg.orig.tar.xz Result: your berkeley-abc-0.0~git20221019.70cb339/src/sat/bsat2/Vec.h:50:24: style: Unused private function: 'vec < vec < Watcher > >::nextCap' [unusedPrivateFunction] Explanation: The PR replaces `find_last_of(" :: ")` with `rfind(" :: ")`. The old call matched single characters, which cut scope names wrongly. With the fix, Cppcheck now instantiates nested specializations such as `vec>`. That instantiation is why this warning is new: it is the same unusedPrivateFunction check applied to the static helper `nextCap`, now reported for one more instantiation. Whether `nextCap` is really unused depends on code not shown. In upstream Minisat, the line is commented out because `capacity()` computes growth inline. ABC uncommented a copy of it, which suggests it may be called somewhere, e.g. in an out-of-line `capacity()` or a related file. If it is unused, the warning is a true positive, but it largely repeats the same finding per instantiation. If ABC's `capacity()` calls it, the warning is a false positive. The visible source is not enough to decide. ---- 15 / 18 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz Result: your vigra-Version-1-12-4/vigranumpy/src/core/export_graph_visitor.hxx:70:5: style: Class 'LemonUndirectedGraphCoreVisitor < MergeGraphAdaptor < AdjacencyListGraph > >' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Explanation: The constructor `LemonUndirectedGraphCoreVisitor(const std::string clsName)` takes one argument and is not marked explicit, so the noExplicitConstructor warning is a true positive. Main already reports it for other instantiations. The PR fixes the scope computation: `find_last_of(" :: ")` matched any single ':' or space character, while `rfind(" :: ")` matches the whole separator. With that fix the template simplifier can now instantiate this nested template (`MergeGraphAdaptor`) within its pass limit. The new warning is therefore a correct true positive that comes from better template understanding. ---- 16 / 18 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz Result: your vigra-Version-1-12-4/vigranumpy/src/core/export_graph_visitor.hxx:70:5: style: Class 'LemonUndirectedGraphCoreVisitor < MergeGraphAdaptor < GridGraph < 2 , boost :: undirected_tag > > >' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Explanation: The constructor `LemonUndirectedGraphCoreVisitor(const std::string clsName)` takes one argument and is not marked `explicit`, so the noExplicitConstructor warning is a true positive. The PR fixes how the template simplifier strips the scope name. `find_last_of(" :: ")` searched for any single character from the set (space or colon), so the wrong scope was kept and each nesting level cost an extra pass. `rfind` searches for the whole separator. As a result, Cppcheck now instantiates more deeply nested templates such as `MergeGraphAdaptor>` and checks them. The new warning comes from that better template coverage, so it is a correct true positive. ---- 17 / 18 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz Result: your vigra-Version-1-12-4/vigranumpy/src/core/export_graph_visitor.hxx:70:5: style: Class 'LemonUndirectedGraphCoreVisitor < MergeGraphAdaptor < GridGraph < 3 , boost :: undirected_tag > > >' has a constructor with 1 argument that is not explicit. [noExplicitConstructor] Explanation: The constructor `LemonUndirectedGraphCoreVisitor(const std::string clsName)` takes one argument and is not marked explicit, so the noExplicitConstructor warning is correct. The PR fixes the scope-name computation: `find_last_of(" :: ")` matched any single character from the set, while `rfind` matches the whole separator. As a result, nested templates are no longer wasting extra simplification passes. This instantiation (MergeGraphAdaptor>) is now fully instantiated, and Cppcheck reports a true positive on it. ---- 18 / 18 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/p/pentobi/pentobi_30.3.orig.tar.xz Result: your pentobi-30.3/libpentobi_base/BoardConst.h:244:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable MAX_SIZE [valueFlowBailoutIncompleteVar] Explanation: The PR fixes a real bug: `find_last_of(" :: ")` matched any single space or colon, while `rfind` matches the whole " :: " substring, so the scope prefix is now computed correctly. The new debug message means the generic template body of `BoardConst::get_move_info` is still in the token list, so the non-type template parameter `MAX_SIZE` is treated as an incomplete variable. That suggests an instantiation of this member template now happens differently, or no longer removes the original. From the shown code alone it is impossible to tell whether the old result was a wrong instantiation (now fixed) or whether the new result is worse. It is only a debug bailout, with no user-visible warning change.