AI review of 2026-11-05_02-54-38-d65d1b8e2934-results.txt PR: #8720 https://github.com/cppcheck-opensource/cppcheck/pull/8720 Tested: d65d1b8e29346ba77e4ab29687391750d284efcd Merge base: a6d2c1777a0203cdbb8df60a70f7d49aeb57aa31 Reviewed: 2026-11-07 09:16:32 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 227 in the report (random sample), 3 not reviewed: valueFlowMaxIterations Verdicts: 18 improvement, 30 regression, 2 unclear Tokens: 101445 input, 3854438 cache read, 78662 cache write, 38869 output The verdicts are written by AI and can be wrong. ---- 1 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/akonadi-contacts/akonadi-contacts_26.08.2.orig.tar.xz Result: your akonadi-contacts-26.08.2/src/akonadi-contacts-core/abstractcontactformatter.cpp:16:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new debug message at the out-of-namespace class definition `class Akonadi::AbstractContactFormatterPrivate`. The code itself did not change, and this file has no function template calls that the new deduction would touch. The likely cause is that the PR moved `createSymbolDatabaseNeedInitialization` (and copy/move constructor detection) into `finalize()`, so it now runs in a different order relative to the other symbol database phases. As a result, the needInitialization pass no longer resolves all user-defined types in this class (members of type `KContacts::Addressee`, `Akonadi::Item`, `QList`). The same message appears in other files of the package. A new 'couldn't resolve' debug message means Cppcheck understands the code less well than before. ---- 2 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/akonadi-contacts/akonadi-contacts_26.08.2.orig.tar.xz Result: your akonadi-contacts-26.08.2/src/akonadi-contacts-core/abstractcontactgroupformatter.cpp:16:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new 'SymbolDatabase couldn't resolve all user defined types' debug message on the qualified class definition 'class Akonadi::AbstractContactGroupFormatterPrivate'. The code is unchanged, ordinary code: a private class with Qt/KContacts members. The message most likely comes from the PR's reordering of symbol database phases (moved into finalize()) or from the template deduction rebuild/incremental update. Main resolved these types without the warning. A new debug message for code main handled cleanly means Cppcheck understands the code worse. ---- 3 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/android-platform-frameworks-native/android-platform-frameworks-native_10.0.0+r36.orig.tar.gz Result: your libs/binder/Parcel.cpp:1681:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: The new line is a debug bailout inside the generic template `Parcel::writeAligned(T val)`. ValueFlow now analyses the uninstantiated body and gives up because `T` is an unknown/incomplete name. Main never emitted this. The PR's new handling of type deduction and deferred template removal (keeping the generic definition while undeduced calls remain) now makes the raw template body visible to the analysis. This adds no useful finding: the bailout only shows that a generic body with an unresolved template parameter is being processed. Per the criteria, a new debug/bailout message caused by the change counts as a regression. ---- 4 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/aom/aom_3.14.1.orig.tar.xz Result: your third_party/googletest/src/googletest/src/gtest-printers.cc:268:34: style: Condition '1<=c' is always true [knownConditionTrueFalse] third_party/googletest/src/googletest/src/gtest-printers.cc:262:9: note: Assuming that condition 'c==0' is not redundant third_party/googletest/src/googletest/src/gtest-printers.cc:268:34: note: Condition '1<=c' is always true Explanation: PrintCharAndCodeTo is a template instantiated with unsigned char, signed char and wchar_t. The PR now deduces these calls (e.g. PrintCharAndCodeTo(c, os) with unsigned char c) and checks the instantiated body. In the unsigned char instantiation, `1 <= c` after `if (c == 0) return;` is indeed always true. For signed char and wchar_t it is not, because negative values are possible. The condition is generic template code that is needed for the other instantiations, so the developer cannot act on this warning. This is a new false positive caused by the template deduction. ---- 5 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/ardour/ardour_9.8.0+ds.orig.tar.xz Result: your ardour-9.8.0+ds/libs/ardour/minibpm.cc:321:10: style: The member function 'breakfastquay::MiniBPM::D::copy < float , double >' can be static. [functionStatic] ardour-9.8.0+ds/libs/ardour/minibpm.cc:321:10: note: The member function 'breakfastquay::MiniBPM::D::copy < float , double >' can be static. ardour-9.8.0+ds/libs/ardour/minibpm.cc:321:10: note: The member function 'breakfastquay::MiniBPM::D::copy < float , double >' can be static. Explanation: `D::copy` is a member function template that never touches `this`, so 'can be static' is correct. Main reported it once, for the template 'copy'. With the PR, deduced instantiations are created and the check runs on each one. The same source line 321 now gets two warnings, 'copy < double , double >' and 'copy < float , double >'. This line is the second one. It points at exactly the same code and the same fix (make the template static), so it is a duplicate. It also names an internal instantiation instead of the function the user wrote. The finding is not wrong, but the output is noisier and less precise. ---- 6 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/ardour/ardour_9.8.0+ds.orig.tar.xz Result: your ardour-9.8.0+ds/libs/ardour/minibpm.cc:325:10: style: The member function 'breakfastquay::MiniBPM::D::zero < double >' can be static. [functionStatic] ardour-9.8.0+ds/libs/ardour/minibpm.cc:325:10: note: The member function 'breakfastquay::MiniBPM::D::zero < double >' can be static. ardour-9.8.0+ds/libs/ardour/minibpm.cc:325:10: note: The member function 'breakfastquay::MiniBPM::D::zero < double >' can be static. Explanation: `D::zero` only writes through its parameter `t` and never touches a member, so 'can be static' is a true positive both before and after. Main reported it against the template name `D::zero`. The PR now instantiates the template through call deduction and reports it against the instantiation `zero < double >`, with two redundant notes that repeat the same location. The user can only make the template static, not one instantiation, so naming the instantiation is less accurate. The extra notes are noise. For `copy` the same change even splits one finding into two warnings on the same line. The finding itself is unchanged, but the message is worse. ---- 7 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/aseba/aseba_1.6.99+dfsg.orig.tar.xz Result: your aseba-1.6.99+dfsg/aseba/common/msg/endian.h:113:21: style: Parameter 'v' can be declared as reference to const [constParameterReference] Explanation: swapEndian(T& v) is the little-endian no-op stub of a function template. The big-endian variant of the same template modifies v, so the non-const reference is part of the API. Before the PR, Cppcheck did not report this generic template. The new call-argument deduction now instantiates it, and the empty body triggers constParameterReference. Following the advice would break the interface shared with the big-endian build, and Cppcheck normally avoids this warning for template-dependent parameter types. This is a new false positive. ---- 8 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/camitk/camitk_6.0.0.orig.tar.xz Result: your camitk-6.0.0/sdk/libraries/qtpropertybrowser/src/qtpropertymanager.cpp:394:54: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable minimumValue [valueFlowBailoutIncompleteVar] Explanation: Line 394 is inside the generic template `setMinimumValue`. The new bailout says `minimumValue` is an incomplete variable: `&PropertyManagerPrivate::Data::minimumValue` depends on a template parameter, so it cannot be resolved in the uninstantiated body. Main did not report this, most likely because it removed the generic definition after instantiation. With the PR the generic body is kept and analyzed. A probable cause is the new deferred-removal/`hasRemainingCalls` logic: `isPlainCall` accepts member calls such as `data.setMinimumValue(...)` on the Data classes. Those are not calls of the free template, but they would still count as remaining calls and keep the generic definition. The result is a new debug bailout on template code that Cppcheck cannot understand, with no real gain for users. ---- 9 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/camitk/camitk_6.0.0.orig.tar.xz Result: your camitk-6.0.0/sdk/libraries/qtpropertybrowser/src/qtpropertymanager.cpp:407:54: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable maximumValue [valueFlowBailoutIncompleteVar] Explanation: The new message is a valueFlow bailout inside the generic body of the static function template `setMaximumValue`. That body uses the dependent name `PropertyManagerPrivate::Data::maximumValue`, which cannot be resolved, hence 'incomplete variable'. On main this generic definition was not analysed this way: it was removed after explicit instantiation. The PR now keeps instantiated function template declarations when `hasRemainingCalls()` finds plain calls with the same name. Its `isPlainCall()` also accepts member calls like `data.setMaximumValue(...)` / `setMaximumValue(...)` on the private Data structs in this file. So the generic template likely stays in the token list and is analysed, producing new debug bailouts at lines 394 and 407. This is an inference from the PR code, not verified against a run. A new bailout from leftover uninstantiated template code means Cppcheck handles the code worse, not better. ---- 10 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/caveexpress/caveexpress_2.6+ds.orig.tar.xz Result: your caveexpress-2.6/src/tools/textureatlas/external/pugixml.cpp:4815:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable status_io_error [valueFlowBailoutIncompleteVar] Explanation: `convert_file_size` is a function template in pugixml's impl namespace. `status_io_error` is an enumerator of `pugi::xml_parse_status`, which is visible there. The new bailout reports `status_io_error` as an incomplete variable, so Cppcheck could not resolve the enumerator in the code it now analyzes. The likely cause is the copy or kept generic definition that the new deduction/deferred-removal logic produces. ValueFlow now skips that function. A new debug bailout caused by failing to resolve a well-defined enumerator means Cppcheck understands this code worse. ---- 11 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/caveexpress/caveexpress_2.6+ds.orig.tar.xz Result: your caveexpress-2.6/src/tools/textureatlas/external/pugixml.cpp:9254:46: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: `new_xpath_variable` is only ever called with explicit template arguments (lines 9269-9278). In main it was instantiated and the generic definition was removed, so its body with the unknown `T` was never analyzed. The PR's `hasRemainingCalls()` decides by name alone whether the generic definition must be kept. The non-template overload `new_xpath_variable(xpath_value_type, const char_t*)` shares that name and is very likely called elsewhere in plain form (e.g. `new_xpath_variable(type, name)`), which would keep the uninstantiated template in the token list. ValueFlow then sees `sizeof(T)` with `T` as an incomplete variable and emits this new bailout. Cppcheck now analyzes a leftover generic template body it cannot understand, so this new debug message is a regression. ---- 12 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/cg3/cg3_1.7.0.orig.tar.bz2 Result: main cg3-1.7.0/src/BinaryApplicator.cpp:401:25: performance: Searching before insertion is not necessary. Instead of 'tag_index[tag]=UI16(tags_to_write.size())' consider using 'tag_index.try_emplace(tag, UI16(tags_to_write.size()));'. [stlFindInsert] Explanation: The stlFindInsert warning itself is unchanged and still valid: there is a find() followed by operator[] insertion on a std::map. Only the message text changed. UI16 is a function template called without explicit template arguments. With the PR, Cppcheck deduces and instantiates it, so the suggested replacement now reads 'UI16 < unsigned long >(tags_to_write.size())' instead of the code the user actually wrote, 'UI16(tags_to_write.size())'. The suggestion no longer matches the source and is uglier to copy, so the message is less accurate. ---- 13 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/collada2gltf/collada2gltf_20140924.orig.tar.xz Result: your collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:29:9: warning: If memory allocation fails, then there is a possible null pointer dereference: buffer [nullPointerOutOfMemory] collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:28:26: note: Assuming allocation function fails collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:28:15: note: Assignment 'buffer=(char*)malloc(bufferSize)', assigned value is 0 collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:29:9: note: Null pointer dereference Explanation: StrDup is a function template that is called without explicit template arguments, presumably as StrDup(str) with a const char* argument. The PR now deduces Ch from the argument type and instantiates StrDup, so the body is checked. In that body, malloc's result is passed straight to memcpy with no null check. If the allocation fails, memcpy dereferences a null pointer. That is a genuine nullPointerOutOfMemory finding, so this is a new true positive. ---- 14 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/collada2gltf/collada2gltf_20140924.orig.tar.xz Result: your collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:29:9: warning: If memory allocation fails, then there is a possible null pointer dereference: buffer [nullPointerOutOfMemory] collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:28:26: note: Assuming allocation function fails collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:28:15: note: Assignment 'buffer=(wchar_t*)malloc(bufferSize)', assigned value is 0 collada2gltf-20140924/dependencies/json/test/unittest/unittest.h:29:9: note: Null pointer dereference Explanation: StrDup passes the result of malloc straight to memcpy without a null check. If allocation fails, memcpy dereferences a null pointer, so this nullPointerOutOfMemory warning is a true positive. Before the PR, calls such as StrDup(wideStr) were never instantiated because Cppcheck could not deduce the template argument, so the body went unchecked. The PR now deduces Ch=wchar_t from the argument type and checks the instantiation, which adds a correct warning. The (wchar_t*) cast in the message matches a wide-string call, which is plausible in rapidjson's unit tests. ---- 15 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/d/djvulibre/djvulibre_3.5.30.1.orig.tar.xz Result: main djvulibre-3.5.30.1/libdjvu/miniexp.cpp:1386:21: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: `minilisp_diezechar_parser` is an array of function pointers `miniexp_t (*[128])(void)`, so it decays to a pointer to such a function pointer. Casting it to `miniexp_macrochar_t*` is, as far as I recall from miniexp.h, a cast to a pointer to the same function pointer type, i.e. effectively an identity conversion. The header is not shown, so this is not certain. That is not a dangerous type conversion. The PR adds a FUNCTION ValueType, so Cppcheck now models function pointer types correctly and no longer flags this harmless cast. Line 1385 lost the same warning for the same reason. The removed warning was a false positive. ---- 16 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/d/dune-grid/dune-grid_2.11.0.orig.tar.gz Result: your dune-grid-2.11.0/dune/grid/test/test-parallel-ug.cc:429:14: debug: Failed to instantiate template "toBitset". The checking continues anyway. [templateInstantiation] Explanation: Line 429 is a recursive variadic function template: `toBitset(codims.set(codim))`. Cppcheck cannot expand parameter packs, and the new type-deduction code explicitly bails out on variadic templates, so the PR does not make this code analyzable. The PR adds a new templateInstantiation debug message saying the simplifier failed to instantiate `toBitset`. Main did not report that failure here, which suggests the changed simplifier passes now attempt an instantiation they cannot complete. Main's incomplete-variable bailout on the same line disappears, but nothing indicates the code is understood better. A new internal failure message points to worse handling of this code. ---- 17 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/d/dune-grid/dune-grid_2.11.0.orig.tar.gz Result: your dune-grid-2.11.0/dune/grid/test/test-parallel-ug.cc:478:12: debug: Failed to instantiate template "checkVector". The checking continues anyway. [templateInstantiation] Explanation: Line 478 is the recursive call `checkVector(gv, data)` inside a variadic member template; its template arguments are given explicitly as a pack expansion. The PR does not make this code any easier to handle: its new deduction cannot deal with variadic templates or explicit pack arguments. What it does change is how instantiated template declarations are kept or removed (deferred removal, remaining calls), and with that change Cppcheck now emits a new 'Failed to instantiate template' debug message for this call. The same kind of message also appears for `toBitset` in this package. A new templateInstantiation debug message, with no gain in understanding of this code, means the PR handles this code worse. ---- 18 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/e/etlcpp/etlcpp_20.48.1+dfsg.orig.tar.xz Result: your etlcpp-20.48.1+dfsg/test/UnitTest++/ExecuteTest.h:24:24: style: Parameter 'testObject' can be declared as reference to const [constParameterReference] Explanation: `ExecuteTest` is a generic function template whose parameter `T& testObject` is used to call `testObject.RunImpl()`. With the PR, calls like `ExecuteTest(*this, ...)` are now instantiated by type deduction. For `Test`, `RunImpl()` is const, so cppcheck concludes the parameter could be const. But the warning lands on the template definition, and other uses (e.g. the `TEST_FIXTURE` helper structs, which declare a non-const `RunImpl()`) need a non-const reference. Changing `T&` to `const T&` would break those instantiations, so this new warning is a false positive. ---- 19 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/farmhash/farmhash_0~git20190513.0d859a8.orig.tar.xz Result: your farmhash-0~git20190513.0d859a8/src/farmhash.cc:394:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable c1 [valueFlowBailoutIncompleteVar] Explanation: The PR now deduces `DebugTweak` from the calls in the `uint128_t` specialization and instantiates it. `c1` is a known `static const uint32_t` declared in the same namespace, so it should never be incomplete. The new bailout shows that in the instantiated copy, which is emitted elsewhere in the token list, `c1` is no longer resolved to its variable. As a result, ValueFlow skips that function. The new debug message shows Cppcheck understands this code worse than before. ---- 20 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/filezilla/filezilla_3.71.0.orig.tar.xz Result: your filezilla-3.71.0/src/include/directorylisting.h:12:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new debug message, 'SymbolDatabase couldn't resolve all user defined types', at the declaration of class CDirentry, and the same message appears in many other headers of this package. Main does not report it here. The class itself is ordinary: members of type std::wstring and fz::shared_value, plus a nested enum. Most likely the incremental symbol database update (or a rebuild after template deduction) now leaves some type pointers unresolved, or the finalize() reordering changed which types get resolved. This new debug output means Cppcheck understands the code worse after the PR. ---- 21 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/filezilla/filezilla_3.71.0.orig.tar.xz Result: your filezilla-3.71.0/src/interface/filelistctrl.h:201:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new 'SymbolDatabase couldn't resolve all user defined types' debug message on the class template CFileListCtrlSort. The same message also appears in many other headers in this package. The code itself did not change, so the new message means the symbol database now resolves types less completely. The likely cause is the new two-phase finalize() and the incremental update after template type deduction leaving some types unresolved. A new debug message of this kind means Cppcheck understands the code worse. ---- 22 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gnss-sdr/gnss-sdr_0.0.22.orig.tar.gz Result: main gnss-sdr-0.0.22/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc:414:31: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: `fcompare` is a function template called without explicit template arguments. In main, `t` stayed an unknown template type, so the redundant cast `(t *)(in2)` (where `in2` is already `t*`) was reported as a potentially dangerous conversion. With the PR, `t` is deduced from the call arguments and the function is instantiated (e.g. with `float`). The cast becomes `float*` to `float*`, which is not dangerous. Cppcheck now reports the accurate style warning `cstyleCast` instead of the misleading `dangerousTypeCast` warning, so this main-only line is the less accurate message going away. ---- 23 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/g/gnss-sdr/gnss-sdr_0.0.22.orig.tar.gz Result: main gnss-sdr-0.0.22/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc:491:96: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Line 491 is inside the function template `icompare(t *in1, t *in2, ...)`, which is called without explicit template arguments. Main only saw the generic body. There `(t *)(in1)` converts to an unknown template type, so it reported the warning-level dangerousTypeCast "potentially invalid type conversion". With the PR, the template arguments are deduced from the call arguments and the function is instantiated. The cast then becomes a cast from `T*` to the same `T*`, which is harmless. The finding is now reported as the style-level cstyleCast "C-style pointer casting". That message is accurate: it is a C-style pointer cast, but the conversion is not invalid. The PR replaced an overstated warning with a correct style message. ---- 24 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/hmat-oss/hmat-oss_1.11.1.orig.tar.gz Result: your hmat-oss-1.11.1/src/compression.cpp:713:33: style:inconclusive: Function 'compress' argument 1 names different: declaration 'compression' definition 'method'. [funcArgNamesDifferent] hmat-oss-1.11.1/src/compression.hpp:176:38: note: Function 'compress' argument 1 names different: declaration 'compression' definition 'method'. hmat-oss-1.11.1/src/compression.cpp:713:33: note: Function 'compress' argument 1 names different: declaration 'compression' definition 'method'. Explanation: The template `compress` is declared in compression.hpp:176 with its first parameter named `compression`. The definition at compression.cpp:713 names it `method`. The companion warning shows the declaration leaves parameter 6 unnamed, which is consistent with a real declaration/definition pair. Before this PR, calls without explicit template arguments were not instantiated, so this template was never checked. With the new type deduction it is instantiated, and Cppcheck correctly links the declaration and the definition. The argument names really differ, so this is a newly found true positive. ---- 25 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/html2text/html2text_2.4.0.orig.tar.bz2 Result: main html2text-v2.4.0/HTMLControl.cpp:650:7: style: C-style pointer casting [cstyleCast] Explanation: Line 650 casts the function pointer `f` (`int(*)(const char*, const char*)`) to `int(*)(const void*, const void*)` for `bsearch`. That is a reinterpret-style cast to an incompatible function pointer type, and calling through it is technically undefined behaviour. With the PR, `f` gets the new FUNCTION value type, so Cppcheck recognises the cast as a pointer conversion between unrelated types. It now reports dangerousTypeCast (warning) instead of the generic cstyleCast (style). The removed message is replaced by a more accurate and more relevant one at the same location. ---- 26 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/html2text/html2text_2.4.0.orig.tar.bz2 Result: your html2text-v2.4.0/HTMLControl.cpp:650:7: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Line 650 casts `f`, of type `int(*)(const char*, const char*)`, to `int(*)(const void*, const void*)` for bsearch. Converting between unrelated function pointer types can only be done with a reinterpret_cast, and calling through the converted pointer is formally undefined behavior. Before the PR, Cppcheck had no type for function pointers and only gave the generic style message cstyleCast. The PR adds a FUNCTION value type, so the check now sees that the cast is a reinterpret-style conversion and reports dangerousTypeCast. That message is more accurate and the warning is justified. ---- 27 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/i/indi-bresserexos2/indi-bresserexos2_1.0+20260316160206.orig.tar.gz Result: main indi-bresserexos2-1.0+20260316160206/ExosIIMountControl.hpp:591:80: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable StartMotion [valueFlowBailoutIncompleteVar] Explanation: The removed line is a debug bailout: valueFlowConditionExpressions skipped `MoveDirection` because `TelescopeSignals::StartMotion` was an incomplete variable. `MoveDirection` is a member template with a non-type parameter, called with explicit template arguments, inside the class template `ExosIIMountControl`. The PR does several things that could explain the change. It moves `createSymbolDatabaseIncompleteVars` into `finalize()`. It re-resolves enumerator tokens copied by the template simplifier. It changes when template declarations are removed or deferred. So the message may have gone because `StartMotion` is now resolved as an enumerator, which would be an improvement. It may also have gone because the function body is no longer analyzed or no longer instantiated, which would be a hidden regression. The source shown is not enough to tell which happened. ---- 28 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kwayland/kwayland_6.7.4.orig.tar.xz Result: your kwayland-6.7.4/src/compat/wayland-xdg-shell-v5-client-protocol.h:557:66: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Column 66 on line 557 points at the cast `(void (**)(void))listener`, not at the `(struct wl_proxy *)` cast. The PR now gives function pointer types a ValueType (FUNCTION). Before, the target type of this cast had no ValueType, so the check could not judge it. Now Cppcheck sees a C-style cast from `const struct zxdg_surface_v5_listener *` to a pointer to function pointer. That is an unrelated-type reinterpret_cast that also casts away const. This is exactly the kind of conversion dangerousTypeCast is meant to flag in C++ code. The pattern is the usual idiom in generated wayland headers and works in practice, but the warning is technically accurate. It is a new true positive found through better type understanding, not a misparse. ---- 29 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kwayland/kwayland_6.7.4.orig.tar.xz Result: your kwayland-6.7.4/src/compat/wayland-xdg-shell-v5-client-protocol.h:993:64: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Line 993 casts `const struct zxdg_popup_v5_listener *`, a pointer to a struct, to `void (**)(void)`, a pointer to a function pointer. In C++ this C-style cast is really a `reinterpret_cast` between unrelated types, and it also casts away const. That is exactly what dangerousTypeCast is meant to report. Before the PR, cppcheck could not give a type to the function-pointer target, so it missed this cast. The PR adds FUNCTION valuetypes and now parses the target type, so the warning appears. The same pattern produces the new warnings at lines 297 and 557. The code is idiomatic, generated Wayland code that works in practice, but the warning describes the conversion accurately. It is a new true positive in the check's own terms. ---- 30 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kylin-ai-vector-engine/kylin-ai-vector-engine_1.2.0.1.orig.tar.gz Result: your kylin-ai-vector-engine-1.2.0.1/thirdparty/folly/folly/synchronization/test/HazptrTest.cpp:332:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable Atom [valueFlowBailoutIncompleteVar] Explanation: Line 332 is inside the function template `basic_holders_test`, whose template template parameter `Atom` has a default. The new bailout treats `Atom` as an incomplete variable. That means Cppcheck is now running ValueFlow on the uninstantiated generic body. The likely cause is the PR's new rule that keeps a template definition while calls without template arguments remain (e.g. `basic_holders_test()`, which has no arguments to deduce from). The generic body is then analysed with the unknown `Atom` and ValueFlow skips the function. The same message appears many times in this file. This is a new debug/bailout message that shows weaker understanding of the code, not better analysis, so it is a regression. ---- 31 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/l/level-zero-gpu-raytracing/level-zero-gpu-raytracing_1.2.4.orig.tar.gz Result: your level-zero-raytracing-support-1.2.4/rtbuild/simd/vboolf4_sse2.h:33:19: warning:inconclusive: Member variable 'vboolf_impl < 4 >::i' is not initialized in the constructor. [uninitMemberVar] Explanation: The explicit specialization vboolf<4> has an anonymous union { __m128 v; int i[4]; } and a default constructor `vboolf() {}` that initializes neither union member. So the inconclusive uninitMemberVar for 'i' is technically correct: a default-constructed object has indeterminate data. Embree may leave it uninitialized on purpose for speed, but Cppcheck reports exactly this pattern by design. The finding is consistent with the sibling files, where the same new warning shows up. In the same run, main's operatorEqVarError on these classes went away; that was a false positive, because assigning v also writes i through the union. The new warning looks like a true positive, but why it now appears is not obvious from the PR, so confidence is low. ---- 32 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/lib2/lib2geom/lib2geom_1.4.orig.tar.bz2 Result: your lib2geom-1.4/tests/timing-test.cpp:72:24: style: Parameter 't' can be declared as reference to const [constParameterReference] Explanation: `robust_timer` is a generic template that takes `T &t` and calls `t()` in a loop. Main never instantiated it. The PR now deduces `T` from a call and checks the instantiated copy, which produces the new constParameterReference warning. Suggesting `const T&` here is questionable: `T` is a callable (functor) and its `operator()` is typically non-const, so it cannot be called through a const reference. Even if this one instantiation happens to have a const call operator, the advice would make the generic template unusable with other functors. The warning is very likely a new false positive caused by checking a deduced template instantiation. ---- 33 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libd/libdivide/libdivide_5.2.0.orig.tar.gz Result: your libdivide-5.2.0/test/DivideTest.h:305:10: style: Unused private function: 'DivideTest < uint64_t >::test_all_numerators' [unusedPrivateFunction] Explanation: `test_all_numerators` is a private member function template of the class template `DivideTest`. The PR adds new type-deduction and deferred template removal. After that change Cppcheck reports this function as unused, but only for the `DivideTest` instantiation. The companion warning on `test_vec` points the same way: `test_vec` is clearly called from `test_vectordivide_numerators` (under the SSE2/AVX/NEON ifdefs). Getting the warning for one instantiation only looks like an artifact of how the PR instantiates or keeps member templates, not a real finding. Before the PR, Cppcheck did not warn about these template members. Whether `test_all_numerators` is truly called somewhere else in the test suite cannot be confirmed from the snippet. Even so, a warning that appears for only one class instantiation is not a reliable report, so this is most likely a new false positive. ---- 34 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libg/libgdiplus/libgdiplus_6.1+dfsg.orig.tar.xz Result: main libgdiplus-6.1+dfsg/external/googletest/googletest/test/googletest-printers-test.cc:942:8: style: struct member 'iterator::x' is never used. [unusedStructMember] Explanation: `struct iterator { char x; }` is passed to the function template `Print(it)`, which prints the object's raw bytes ("1-byte object <00>"). So the storage of `x` is actually read, and the member exists to give the test object a defined one-byte value. With the PR, the template arguments of `Print(it)` are deduced from the argument type, so `Print` is instantiated. The unusedStructMember check intentionally bails out when a struct is used as a template argument, because generic code may access its members. Dropping this warning matches that design, and it was at best a noisy warning for a member whose bytes are used. The matching const_iterator warning disappears for the same reason. ---- 35 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libg/libgrokj2k/libgrokj2k_10.0.5.orig.tar.gz Result: your src/lib/core/t1/part1/impl/T1.cpp:1030:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable vsc [valueFlowBailoutIncompleteVar] Explanation: Line 1030 is the body of the generic template `template void T1::dec_clnpass(int32_t)`. Its only uses are the explicit instantiations `dec_clnpass<64,64,true/false>`. Before the PR, the generic template was removed once those instantiations were made, so no warning was reported for it. The PR keeps a template's definition when 'plain calls' with the same name remain. Calls to the non-template overload `dec_clnpass(bpno, cblksty)` most likely look like such calls to the heuristic, so the generic definition is not removed. ValueFlow then analyzes the uninstantiated body, where `vsc` is a template parameter with no declaration, and bails out with a new debug message. A new bailout on code Cppcheck previously handled cleanly means it now understands this code worse. ---- 36 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libp/libpwiz/libpwiz_3.0.18342.orig.tar.gz Result: your libpwiz-src-301b48c-3.0.18342/pwiz/data/msdata/Serializer_mzXML.cpp:48:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: Only the PR build reports the debug message 'SymbolDatabase couldn't resolve all user defined types' at the out-of-line class definition `class Serializer_mzXML::Impl`. The source did not change, so the message comes from the PR's new code: the template type deduction rounds, the incremental or rebuilt symbol database, or the changed symbol removal. Cppcheck now fails to resolve a user-defined type it resolved before, which can hurt later analysis. A new debug message that shows worse understanding is a regression. ---- 37 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mana/mana_0.8.0.orig.tar.gz Result: your mana-0.8.0/src/utils/dtor.h:34:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new debug message 'SymbolDatabase couldn't resolve all user defined types' at the partial specialization `struct dtor>`. The code is valid. The PR's new type deduction rounds and incremental symbol database updates keep or rebuild template declarations, which leaves types unresolved that main handled without complaint. A new debug message on code main analysed cleanly means Cppcheck now understands this code worse. ---- 38 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/n/nextpnr/nextpnr_0.11.1+dfsg.orig.tar.xz Result: your nextpnr-0.11.1/3rdparty/QtPropertyBrowser/src/qtpropertymanager.cpp:383:54: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable maximumValue [valueFlowBailoutIncompleteVar] Explanation: The new bailout is reported inside the generic body of the function template `setMaximumValue`. There, `PropertyManagerPrivate::Data::maximumValue` depends on a template parameter and cannot be resolved. Main did not report it. In this file the template appears to be called only with explicit template arguments, so main likely instantiated it and then removed the generic definition. The PR keeps a generic definition when `hasRemainingCalls()` finds plain calls with the same name. That check matches by name only, so an unrelated member call such as `x.setMaximumValue(...)` on a `Data` or manager object probably counts as a remaining call. The uninstantiated template body then stays in the token list and is analysed, which produces this incomplete-variable bailout. A new debug/bailout message caused by leftover uninstantiated template code is a regression. ---- 39 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/perfetto/perfetto_56.0.orig.tar.gz Result: main perfetto-56.0/src/profiling/perf/regs_parsing.cc:65:64: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: `ReadValue` is a function template with a `T*` parameter. It is called without explicit template arguments, e.g. `ReadValue(&x, ptr)`. Before the PR, only the uninstantiated generic body was analyzed, so `T` was an incomplete variable and ValueFlow bailed out. The PR deduces `T` from the argument type of `T*` parameters, instantiates the function and removes the generic definition. The debug bailout goes away because Cppcheck now analyzes a concrete instantiation. ---- 40 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/plasma-framework/plasma-framework_5.116.0.orig.tar.xz Result: your plasma-framework-5.116.0/src/declarativeimports/calendar/eventdatadecorator.h:16:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: Only the PR build reports the debug message "SymbolDatabase couldn't resolve all user defined types" for class EventDataDecorator (base QObject, member CalendarEvents::EventData). Nothing in this header changed. Main does not report the message on the same code, so the PR's new template-deduction rounds (symbol database rebuild or incremental update, deferred finalize) most likely left type resolution worse. A new debug message that means Cppcheck understands the code worse counts as a regression. ---- 41 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qtwayland-opensource-src/qtwayland-opensource-src_5.15.19.orig.tar.xz Result: your qtwayland-everywhere-src-5.15.19/src/plugins/shellintegration/xdg-shell-v5/pregenerated/3rdparty/wayland-xdg-shell-unstable-v5-client-protocol_p.h:1060:10: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] Explanation: Line 1060 casts `listener`, a `const struct xdg_popup_listener *`, to `void (**)(void)` with an old-style cast in a C++ header. That one cast both drops the const and reinterprets an unrelated struct pointer as a pointer to a function pointer. In C++ this would need const_cast plus reinterpret_cast, which is what dangerousTypeCast is meant to flag. Before the PR Cppcheck had no ValueType for the function-pointer cast target, so the check missed it. The PR adds the FUNCTION type, so the cast is now understood and correctly reported. The code is generated and the idiom is common in Wayland bindings, but the warning is accurate, so this is a newly found true positive. ---- 42 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/r-cran-readr/r-cran-readr_2.2.0.orig.tar.gz Result: your readr/src/QiParsers.h:354:30: style: Comparing expression of type 'signed int &' against value -2147483648. Condition is always false. [compareValueOutOfTypeRangeError] Explanation: With the PR, cppcheck deduces the template arguments of the `parseInt(first, last, res)` call and instantiates the function. The diagnostic shows `Attr&` resolved to `int&`. For an `int`, `res < INT_MIN` can never be true, so the warning is correct. It also points at a real bug: the comment says the range check is meant for the 64-bit `long lres` returned by `strtol`, but the code compares `res` instead of `lres`. This is a new true positive, enabled by type deduction from non-literal arguments. ---- 43 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/r/rxvt-unicode/rxvt-unicode_9.31.orig.tar.bz2 Result: your rxvt-unicode-9.31/src/estl.h:13:86: style: C-style pointer casting [cstyleCast] Explanation: Line 13 is a generic `swap(T&, U&)` template that uses `(T)b` and `(U)t` for arbitrary types. The new type deduction instantiates it for a call with pointer arguments, so `(T)b` becomes something like `(X*)b`, and cstyleCast fires on the template source line. The user never wrote a pointer cast: it is a generic cast to a template parameter. For identically typed pointer arguments it does nothing, and the warning cannot be fixed per instantiation. This is noise caused by the instantiation, not a real pointer-cast issue in the code, so it is a new false positive. ---- 44 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/s3fs-fuse/s3fs-fuse_1.97.orig.tar.gz Result: your s3fs-fuse-1.97/src/test_curl_util.cpp:122:5: error: Null pointer dereference [nullPointer] Explanation: Line 122 calls `ASSERT_EQUALS(static_cast(0), curl_slist_length(list))`. This expands to the template `assert_equals(const T& x, const T& y, ...)`, which only does `if (x != y)`. The PR now deduces and instantiates `assert_equals`. Cppcheck then treats the integer value 0 bound to a `const unsigned long&` as a null pointer and reports a dereference at the call site. Nothing here is a pointer, and no null pointer is dereferenced, so this is a new false positive caused by the deduction. ---- 45 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/simgear/simgear_2024.1.5+dfsg.orig.tar.xz Result: main simgear-2024.1.5/simgear/math/SGLineSegment.hxx:53:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: The removed message is a debug bailout. It fired because the uninstantiated template body of SGLineSegment::transform was analysed with 'T' treated as an unknown incomplete variable. With the PR, deduction instantiates the templates that are used, such as SGBox/ and SGTriangle/ seen in the other diff lines. So the generic template body with the unresolved T is no longer analysed, or is analysed as a concrete instantiation where T is a known type. The bailout disappears because Cppcheck now understands the code better. ---- 46 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/s/syncthingtray/syncthingtray_2.0.10.orig.tar.xz Result: your syncthingtray-2.0.10/syncthingwidgets/tests/wizard.cpp:31:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: The PR adds a new debug message 'SymbolDatabase couldn't resolve all user defined types' at the class WizardTests. Main did not report it. The class uses Qt and project types from headers that are probably not included in the analysis (QObject, QTemporaryDir, Data::SyncthingLauncher, ...). Main was able to handle this case without the message. The PR splits symbol database creation into the constructor plus finalize(), adds an incremental update and rebuilds after template deduction. The new message most likely comes from that changed order: createSymbolDatabaseIncompleteVars and the type pointers now run after incremental updates or a rebuild. So Cppcheck now resolves types worse or reports differently. A new debug message like this one indicates a regression in Cppcheck's understanding of the code. ---- 47 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/t/tigr-glimmer/tigr-glimmer_3.02b.orig.tar.gz Result: your glimmer3.02/SimpleMake/delcher.hh:135:9: style:inconclusive: Function 'Max < double >' argument 1 names different: declaration '' definition 'A'. [funcArgNamesDifferentUnnamed] Explanation: The header forward-declares `template DT Max(DT, DT);` with unnamed parameters, and the definition at line 135 names them `A` and `B`. Before the PR, calls like `Max(x, y)` with variable arguments were not instantiated, so no check saw this function. With type deduction, `Max` is now instantiated, and funcArgNamesDifferentUnnamed reports exactly what it reports for ordinary functions: the declaration's argument 1 is unnamed while the definition calls it `A`. The finding matches the source and is a new true positive of this inconclusive style check. Minor drawbacks: it is reported once per instantiation (`Max` and `Max` at the same location), and the function is named 'Max < double >' rather than 'Max'. ---- 48 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/x/x265/x265_4.2.orig.tar.gz Result: your x265_4.2/source/common/scaler.cpp:680:14: style: Variable 'vCrFilterPos' can be declared as pointer to const [constVariablePointer] Explanation: `vCrFilterPos` is a local `int32_t*` copied from a member, and the visible code only reads through it: `vCrFilterPos[crDstY]` passed to `x265_max`. In x265, `x265_max` is a function template that takes `T` by value. Before the PR, the call `x265_max(1 - vCrFilterSize, vCrFilterPos[crDstY])` was never instantiated, so Cppcheck had to assume the element might be modified. With the new type deduction it is instantiated as `x265_max(int, int)`, so Cppcheck sees a plain read. Declaring the pointer as `const int32_t*` would be valid, which makes this a new true positive. Confidence is not high because the rest of the function after line 720 is not shown. ---- 49 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/x/xsimd/xsimd_14.3.0.orig.tar.gz Result: main xtensor-stack-xsimd-4643817/test/test_shuffle.cpp:218:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable activate_above_below_checks [valueFlowBailoutIncompleteVar] Explanation: `activate_above_below_checks` is brought in with `using base::activate_above_below_checks;` from a dependent base, `init_slide_base`. Cppcheck still cannot resolve such a dependent-base member, and nothing in the PR adds that ability. The bailout disappears at both lines 218 and 258. That points to a change in how this class template body is processed, not to the variable becoming known. Possible causes are the incomplete-variable computation moving into `finalize()`, or different instantiation or removal of templates. The output does not show whether the function is now analysed properly or simply skipped or removed, so it cannot be classed as an improvement or a regression. ---- 50 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/y/yuview/yuview_2.14.orig.tar.gz Result: your YUView-2.14/YUViewLib/src/playlistitem/playlistItemImageFile.h:42:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: Only the PR build reports the debug message 'SymbolDatabase couldn't resolve all user defined types' at the declaration of class playlistItemImageFile, which derives from playlistItem. The source code is unchanged, so the main build resolved these types and the PR build no longer does. The likely cause is the PR's new template deduction rounds, which rebuild or incrementally update the symbol database (deferred template removal, removeSymbolsForTokens). Somewhere in that process a type link, probably the base class or a member type, is lost. A new debug/bailout message like this means Cppcheck now understands the code less well.