AI review of 2026-10-16_19-56-40-73fd65a22541-results.txt PR: #8720 https://github.com/cppcheck-opensource/cppcheck/pull/8720 Tested: 73fd65a22541fa6cb7d105f469a5e8e3ee833746 Merge base: 99ad2a83ab14c29d753272388b916887d936af03 Reviewed: 2026-10-17 21:34:23 UTC Model: claude-opus-5-5 (effort high) Results: 50 reviewed of 208 in the report (random sample) Verdicts: 17 improvement, 2 neutral, 28 regression, 3 unclear Tokens: 121228 input, 3055200 cache read, 763800 cache write, 35461 output The verdicts are written by AI and can be wrong. ---- 1 / 50 ---- Verdict: NEUTRAL (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/ardour/ardour_9.8.0+ds.orig.tar.xz Result: main ardour-9.8.0+ds/libs/ardour/minibpm.cc:329:10: style: The member function 'breakfastquay::MiniBPM::D::unityNormalise' can be static. [functionStatic] Explanation: `unityNormalise` is a member function template of `MiniBPM::D` that uses no members, so it really can be static. Main reported this on the uninstantiated template. With the PR, the call is now deduced and instantiated as `unityNormalise`, and the same warning appears at the same line with the instantiated name. The finding is the same true positive; only the name in the message changed, which does not matter much to users. ---- 2 / 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/gtk2_ardour/bundle_manager.h:69:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: This new debug message comes from the needInitialization pass. It reports that Cppcheck could not resolve all user-defined types of class BundleEditor, whose members are a BundleEditorMatrix, a shared_ptr and Gtk types. Nothing in this code changed. The PR moved createSymbolDatabaseNeedInitialization() into finalize(), so it now runs after the template-deduction rebuild or incremental update of the symbol database. The new message on several gtk2_ardour classes shows the symbol database is now less complete or consistent at that point. A newly added debug/bailout message is a regression for users, even though no warning was lost. ---- 3 / 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/gtk2_ardour/io_button.h:50:1: debug: SymbolDatabase couldn't resolve all user defined types. [debug] Explanation: Line 50 declares `IOButtonBase`, which derives from `ArdourWidgets::ArdourButton`. That class is defined in another header, so Cppcheck cannot resolve it with or without the PR. The code itself is unchanged, yet the PR now reports this debug message where main did not. The likely cause is the new code that rebuilds or incrementally updates the SymbolDatabase after template type deduction. That rebuild seems to recheck user-defined types and report the failure again (or for the first time) on unrelated class declarations. No new type information is gained here. The result is extra debug noise caused by the PR's rebuild path, not better understanding of the code. ---- 4 / 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: `MiniBPM::D::copy` is a member function template that never uses `this`, so it can indeed be static. Main reported this once, against the template `copy`, which is the accurate and actionable message. With the PR, type deduction now instantiates the template (e.g. `copy` from a const float* source and double* target), and functionStatic reports each instantiation separately at the same line, with duplicated notes. This warning is not a new finding; it splits the same issue into per-instantiation duplicates. It also names an instantiation that the user cannot make static on its own. The output is noisier and less accurate than before. ---- 5 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/a/astc-encoder/astc-encoder_5.3.0+ds.orig.tar.xz Result: your ARM-software-astc-encoder-30aabb3/Source/astcenc_averages_and_directions.cpp:645:27: debug: Failed to instantiate template "swz". The checking continues anyway. [templateInstantiation] Explanation: Line 645 calls the member template `blk.data_mean.swz<0, 1>()`, which uses explicit template arguments and needs no type deduction. Main did not report a templateInstantiation debug message here. The PR adds a type-information round that rebuilds or incrementally updates the token data and changes the simplifier state (deferred removals, a persistent set of expanded names, a reset of the declaration lists). After that, the simplifier can no longer instantiate `swz` at this call. The new debug message shows Cppcheck now understands this code worse. ---- 6 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/a/astc-encoder/astc-encoder_5.3.0+ds.orig.tar.xz Result: your ARM-software-astc-encoder-30aabb3/Source/astcenc_weight_align.cpp:426:31: style: Parameter 'tmpbuf' can be declared as reference to const [constParameterReference] Explanation: The function binds non-const array references to members of `tmpbuf` (e.g. `float (&low_value1)[...] = tmpbuf.weight_low_value1;`). It then writes through them: `low_value1[i] = ...`, and `low_values1[i]` is passed as an output argument. If `tmpbuf` were `const&`, binding non-const references to its members would not compile, so it cannot be declared const. The new constParameterReference warning is a false positive. It appeared with the PR's symbol database and template changes, which is a regression. ---- 7 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/b/bespokesynth/bespokesynth_1.3.0+dfsg.orig.tar.xz Result: main bespokesynth-1.3.0+dfsg/Source/NoteCanvas.cpp:408:65: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable y [valueFlowBailoutIncompleteVar] Explanation: The removed line is a ValueFlow debug bailout: the function was skipped because `y` in `rect1.getCenter().y` was an incomplete variable. With the PR, no bailout of any kind is reported for this function, so `y` is no longer seen as incomplete and ValueFlow now analyses the function. This fits the PR's changes: it adds template argument deduction from argument types and computes incomplete variables only after template simplification. That suggests Cppcheck understands the member access better, but the exact cause cannot be confirmed from the shown code. ---- 8 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/b/bespokesynth/bespokesynth_1.3.0+dfsg.orig.tar.xz Result: your bespokesynth-1.3.0+dfsg/Source/Monome.h:40: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', on class Monome. Monome derives from juce::OSCReceiver and from the template base juce::OSCReceiver::Listener<...>. The source code did not change, and main does not report this message. So the new type-deduction path is the likely cause: either the extra template simplification rounds or the rebuild/incremental update of the symbol database leaves a base type unresolved. A new symbol-database debug message means Cppcheck understands this code worse than before. ---- 9 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/c/ccls/ccls_0.20261004.orig.tar.gz Result: your ccls-0.20261004/index_tests/constructors/make_unique_forward.cc:2:37: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable args [valueFlowBailoutIncompleteVar] Explanation: The new output is a debug bailout: valueFlowConditionExpressions now skips the function because the variadic pack parameter `args` in `new T(static_cast(args)...)` is treated as an incomplete variable. The calls `fake_make_unique(...)` give explicit template arguments, so the new deduction code should not touch them. The likely cause is the PR's restructuring: incomplete-variable computation moved into `finalize()`, symbol database rebuild/incremental update, and token type resets. After it, Cppcheck no longer links `args` to its declaration in this function. Main did not report this bailout. A new bailout points to worse code understanding, but the exact cause is uncertain. ---- 10 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/c/ccls/ccls_0.20261004.orig.tar.gz Result: your ccls-0.20261004/index_tests/templates/deduce_auto_type_in_template.cc:11:10: style: Variable 'y' is assigned a value that is never used. [unreadVariable] Explanation: `two(T t) { auto y = t; }` copies the parameter into the local `y`, and `y` is never read. Before the PR, the calls `two(Foo())` and `two(Bar())` were not instantiated because type deduction only handled literal arguments. Now T is deduced as Foo and Bar, both trivial empty structs, so Cppcheck checks the instantiated bodies. In those bodies `y` really is assigned and never used, so this is a new true positive. ---- 11 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/c/ccls/ccls_0.20261004.orig.tar.gz Result: your ccls-0.20261004/index_tests/templates/deduce_auto_type_in_template.cc:7:10: style: Variable 'x' is assigned a value that is never used. [unreadVariable] Explanation: The PR adds type deduction from non-literal arguments, so `one(Foo())` now instantiates `one` and its body gets checked. In that body, `auto x = t;` copies `t` into a local `x` that is never read. `Foo` is an empty struct with no constructor or destructor side effects, so the assignment really is dead. This is a new true positive that was missed before because the template was never instantiated. ---- 12 / 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. Before this PR it was only instantiated when its type argument could be deduced from a literal. Calls with a `const char*` variable (and a `const wchar_t*` one) were left uninstantiated, so its body was not analyzed. With the new type deduction, `StrDup` is instantiated, and the deduction is correct: a `const char*` argument for a `const Ch*` parameter gives `Ch` = `char`. The body calls `malloc` and passes the result to `memcpy` without a null check, so `memcpy` gets a null pointer if the allocation fails. This is a genuine `nullPointerOutOfMemory` finding that Cppcheck reports for the same code in non-template functions, so this is a newly found true positive. ---- 13 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/d/delly/delly_1.7.2.orig.tar.xz Result: your delly-1.7.2/src/asmode.h:341:18: style: Parameter 'c' can be declared as reference to const [constParameterReference] Explanation: With the PR, cppcheck deduces the template argument of the call `runAsm(c)` from the variable's type. It can then instantiate and check `runAsm`. In the visible code, `c` is only read: `c.files.size()` and passing it to helpers such as `_findAsmStructuralVariants` and `_setAsmConsensus`. In delly these helpers take `TConfig const&`. Cppcheck only reports this when every use is const, because unknown or non-const calls block the warning. So `TConfig& c` could be `TConfig const& c`, and the new warning looks like a true positive. The rest of the function body is not shown, which keeps confidence at medium. ---- 14 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/e/evolvotron/evolvotron_0.8.3.orig.tar.gz Result: your evolvotron-0.8.3/libfunction/function_node.h:149:40: warning: The class 'FunctionBoilerplate' defines member function with name 'create' also defined in its parent class 'FunctionNode'. [duplInheritedMember] Explanation: The new warning flags the static factory `FunctionNode::create(...)` at line 149 because `FunctionBoilerplate`, a class template deriving from `FunctionNode`, also declares a static `create`. That derived declaration is not shown. If it exists, the name hiding is real but almost certainly intentional (a per-type static factory), so the warning is technically accurate but of little value to users. It is not clear why the PR newly produces it. The PR changes the symbol database build order (finalize), incremental updates and function template deduction, not class template handling. The message names plain 'FunctionBoilerplate', not an instantiation, so it seems to come from the uninstantiated template scope. Without the derived class source and the reason for the change, it cannot be judged as a correct new detection or a side effect of an inconsistent symbol database. ---- 15 / 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: With the PR, the call `DebugTweak(Uint128Low64(x))` inside the `uint128_t` specialization is now type-deduced, so `DebugTweak` gets instantiated. In that instantiation, `c1` is not linked to its declaration. `c1` is a perfectly ordinary `static const uint32_t` declared at namespace scope a few lines above. The likely cause is that the incremental varid/symbol-database update does not resolve the namespace variable in the newly copied body, which is appended after the namespace. ValueFlow therefore marks `c1` as an incomplete variable and skips the whole function. The new bailout reflects a gap in how Cppcheck resolves the instantiated code, not a real ambiguity in the source. ---- 16 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/f/fwbuilder/fwbuilder_5.3.7.orig.tar.gz Result: main fwbuilder-5.3.7/src/libfwbuilder/src/fwbuilder/uint128.h:480:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: `__do_div` is a private static member template taking `(const T&, const T&, T&, T&)`. It is presumably called from the uint128 division operators with uint128 arguments such as `*this` and other members; the call site is not shown. Before the PR, only literal arguments could be deduced, so the template stayed uninstantiated. ValueFlow then bailed out on its body because `T` (in `sizeof(T)`) was an incomplete variable. The PR deduces `T` from the argument types; the `const T &` and `T &` parameter forms and record types are supported. The template is therefore instantiated with a concrete type and the generic body with the unknown `T` is removed. The disappearing bailout reflects that Cppcheck now analyzes a concrete instantiation. ---- 17 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/h/hm/hm_18.0.orig.tar.gz Result: your HM-HM-18.0/source/Lib/TLibCommon/TComDataCU.cpp:1661:48: style:inconclusive: Function 'setSubPart < bool >' argument 2 names different: declaration 'pbBaseCtu' definition 'puhBaseCtu'. [funcArgNamesDifferent] HM-HM-18.0/source/Lib/TLibCommon/TComDataCU.h:335:66: note: Function 'setSubPart < bool >' argument 2 names different: declaration 'pbBaseCtu' definition 'puhBaseCtu'. HM-HM-18.0/source/Lib/TLibCommon/TComDataCU.cpp:1661:48: note: Function 'setSubPart < bool >' argument 2 names different: declaration 'pbBaseCtu' definition 'puhBaseCtu'. Explanation: `setSubPart` is a member function template. The call `setSubPart(bMergeFlag, m_pbMergeFlag, ...)` relies on argument deduction, which main could not do from a variable argument, so `setSubPart` was never instantiated and never checked. With the PR, T is deduced as bool and the instantiation is checked. The definition at line 1661 names the second parameter `puhBaseCtu`, while the note shows the declaration in TComDataCU.h:335 names it `pbBaseCtu`. The names really differ, so this new funcArgNamesDifferent warning is a true positive. The instantiation-style name 'setSubPart < bool >' in the message is slightly unusual but not wrong. ---- 18 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:62:17: warning: %f in format string (no. 3) requires 'double' but the argument type is 'char'. [invalidPrintfArgType_float] Explanation: The PR now deduces T for check1 from the variable types, so check1 gets instantiated for int8_t (char), int16_t, int32_t and int64_t. Line 62 sits inside an `if constexpr (std::is_same::value)` branch, which is discarded for every non-float T. Cppcheck does not evaluate `if constexpr` with std::is_same, so it checks the printf with a char argument that can never be compiled in. The new invalidPrintfArgType_float warning is therefore a false positive. ---- 19 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:62:17: warning: %f in format string (no. 3) requires 'double' but the argument type is 'signed short'. [invalidPrintfArgType_float] Explanation: The PR now deduces T from variable arguments, so it instantiates check1 and similar functions. In those instantiations the printf on line 62 sits inside an `if constexpr (std::is_same::value)` branch that is discarded for int16_t. Cppcheck does not drop discarded constexpr branches, so it checks the %f format against a short argument. That code is never compiled for short, so the new warning is a false positive. ---- 20 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:62:17: warning: %f in format string (no. 4) requires 'double' but the argument type is 'char'. [invalidPrintfArgType_float] Explanation: check1 is a template, and the printf with %f is inside an `if constexpr (std::is_same::value)` branch. That branch is only compiled when T is float. The PR now deduces T from calls such as check1(src_a, dst, count) and instantiates check1 and similar. Cppcheck does not discard the false `if constexpr` branches in those instantiations, so it reports the float-only printf with a char argument. That code is never instantiated for char, so the warning is a false positive. ---- 21 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:64:17: warning: %lf in format string (no. 3) requires 'double' but the argument type is 'char'. [invalidPrintfArgType_float] Explanation: With the PR, check1 is now instantiated with T deduced from the call arguments, e.g. check1 or check1. The printf at line 64 sits inside `if constexpr (std::is_same::value)`. That branch is discarded when T is char/int/short/long, so the printf is never compiled for those types. Cppcheck does not honour if constexpr here and checks the discarded branch, so it reports a char argument for %lf. This is a false positive caused by the new deduction. ---- 22 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:64:17: warning: %lf in format string (no. 4) requires 'double' but the argument type is 'char'. [invalidPrintfArgType_float] Explanation: The PR now deduces `T` for `check1(src_a, dst, count)` from the variables and instantiates `check1` (char) and the other integer types. The printf at line 64 is in an `if constexpr (std::is_same::value)` branch, so for any `T` other than double it is discarded at compile time. Cppcheck does not evaluate `std::is_same`, so it keeps the dead branch in the `char` instantiation. It then reports `%lf` with a `char` argument, which cannot happen at runtime. This is a new false positive. ---- 23 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:64:17: warning: %lf in format string (no. 4) requires 'double' but the argument type is 'signed long'. [invalidPrintfArgType_float] Explanation: check1 is now instantiated through the new type deduction, here with T = int64_t (signed long). The printf on line 64 sits inside an `if constexpr (std::is_same::value)` branch, which is discarded for T = int64_t, so it is never compiled with a long argument. Cppcheck does not prune the discarded constexpr branch in the instantiation and warns that a signed long is passed to %lf. That is a false positive. ---- 24 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/i/ispc/ispc_1.28.2.orig.tar.gz Result: your ispc-ispc-5bf8fb9/benchmarks/01_trivial/09_shuffle.cpp:84:17: warning: %f in format string (no. 4) requires 'double' but the argument type is 'signed int'. [invalidPrintfArgType_float] Explanation: With the PR, check2 is now instantiated as check2 through type deduction. The printf at line 84 is inside 'if constexpr (std::is_same::value)', so for T=int that branch is discarded and never compiled or executed. Cppcheck does not evaluate the if constexpr condition and checks the dead branch, so it reports %f with a 'signed int' argument. That is a false positive, and it was added by the PR. ---- 25 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kdc2tiff/kdc2tiff_0.35.orig.tar.gz Result: your kdc2tiff-0.35/GICBayer.cpp:137:45: style: Parameter 'id' can be declared as pointer to const [constParameterPointer] Explanation: In `green_make_up`, `id` is only read in the visible code: `id[...]` is used as an initializer and passed as an argument to `MIN`/`MAX`. The sibling functions `green_better_middle` and `green_better_edges` presumably already got this warning from main, since the diff contains no lines for them. The likely difference is that `MIN`/`MAX` are function templates called with non-literal arguments. Main could not instantiate them and treated `id[...]` as possibly passed by non-const reference. The PR deduces the template arguments (e.g. `MIN`), so Cppcheck sees the arguments are taken by value and `id` is never written. This makes the new warning a likely true positive, assuming the rest of the function (not shown) only writes to `tl`. ---- 26 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/k/kldap/kldap_26.08.2.orig.tar.xz Result: your kldap-26.08.2/src/core/ldapclientsearch.h:24: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', for the plain struct LdapResultObject. That struct has an ordinary pointer member and an LdapObject member, so there is nothing unusual about it. Main did not report this. The PR adds a template type-deduction round that rebuilds or incrementally updates the symbol database, and moves createSymbolDatabaseIncompleteVars and some other phases into finalize(). Either change can leave type pointers unresolved after a deduction round, for example when tokens are recreated or Type objects are removed and re-added. A new debug/bailout message means Cppcheck now understands this code worse. ---- 27 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/l/labplot/labplot_2.12.1.orig.tar.xz Result: your labplot-2.12.1/src/3rdparty/liborigin/tree.hh:1547:0: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable sibling_iterator [valueFlowBailoutIncompleteVar] Explanation: This new debug bailout appears in `tree::merge()` at the `append_child(parent(to1), *from1)` call. `parent` and `append_child` are member function templates, and the PR's new type-based deduction now instantiates them from `sibling_iterator` arguments. In the rebuilt code `sibling_iterator`, a nested iterator type of the class template, ends up treated as an unknown variable, so ValueFlow skips the whole function. A type name seen as an incomplete variable means the new instantiation is not fully understood. The new `operatorEqVarError` warnings in the same file point to the same problem. ---- 28 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp_1.9.8.orig.tar.gz Result: main open-source-parsers-jsoncpp-8519b83/src/test_lib_json/main.cpp:2296:18: style: Variable 'value1' can be declared as reference to const [constVariableReference] Explanation: `value1` is a `Json::Value&` bound to `path1.make(root)`. Its only use is as the `actual` argument of `JSONTEST_ASSERT_EQUAL`, which calls the function template `JsonTest::checkEqual`. That template never modifies the argument, and because it is a template, declaring `value1` as `const Json::Value&` would compile in any case. So the constVariableReference warning is a true positive. The PR now deduces the template arguments of that call (likely `checkEqual`) and instantiates it, which apparently makes the const analysis treat the argument as possibly modified. As a result the valid warning is lost, together with the identical one for `value2`. Losing a true positive is a regression. ---- 29 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libj/libjsoncpp/libjsoncpp_1.9.8.orig.tar.gz Result: main open-source-parsers-jsoncpp-8519b83/src/test_lib_json/main.cpp:2300:18: style: Variable 'value2' can be declared as reference to const [constVariableReference] Explanation: `value2` is a non-const `Json::Value&` that is only read: it is passed to `JSONTEST_ASSERT_EQUAL`. That macro calls `JsonTest::checkEqual(result, T expected, U actual, ...)`, which takes `actual` by value. Nothing modifies `value2`, so declaring it as a reference to const is valid and the warning was a true positive. The PR now deduces `checkEqual` from the call. After that, Cppcheck stops reporting both `value1` and `value2`, although the instantiated function still takes the argument by value. A correct style finding was lost. ---- 30 / 50 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libm/libmemcached/libmemcached_1.1.4.orig.tar.gz Result: main libmemcached-1.1.4/src/libhashkit/murmur3.cc:44:54: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: The template getblock is called as getblock(blocks, i), where blocks is a const uint32_t*. Before the PR, Cppcheck could not deduce T from a non-literal argument, so the uninstantiated template body stayed in the token list. ValueFlow then bailed out on the incomplete variable T. The PR deduces T from the argument's ValueType (the 'const T *' shape gives T = uint32_t), instantiates getblock and removes the template body. The bailout disappears because Cppcheck now understands the code and analyzes the real instantiation. ---- 31 / 50 ---- Verdict: REGRESSION (low confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libofx/libofx_0.10.9.orig.tar.gz Result: your libofx-0.10.9/lib/tree.hh:1035:0: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable pre_order_iterator [valueFlowBailoutIncompleteVar] Explanation: Line 1035 is in the out-of-class member function `tree::replace`. `pre_order_iterator` is a nested class type of `tree`, not a variable. The new bailout means Cppcheck now treats `pre_order_iterator` as an incomplete variable. So it no longer resolves this type in this function and skips valueFlowConditionExpressions for it. This probably comes from the reordered or incremental symbol database phases (incomplete vars are now computed in `finalize()` after template re-simplification). It may also come from the instantiated `tree` code being handled differently: the new `operatorEqVarError` on the same class points to that. Either way, a new bailout on a known type means worse understanding of the code. It is not clear whether this code was simply not analysed before, hence low confidence. ---- 32 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libofx/libofx_0.10.9.orig.tar.gz Result: your libofx-0.10.9/lib/tree.hh:1255:0: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable sibling_iterator [valueFlowBailoutIncompleteVar] Explanation: The new line is a debug bailout: ValueFlow now skips `tree<...>::merge` because it treats `sibling_iterator` as an incomplete variable. In the code, `sibling_iterator` is a nested iterator class of `tree`, used as a type (`sibling_iterator fnd;` and as parameter types), not an unknown variable. The PR re-runs template simplification with type information, which may rebuild the symbol database or update it incrementally. It also moves `createSymbolDatabaseIncompleteVars()` into `finalize()`. After these changes, the nested type is no longer resolved in this out-of-class member definition. Other new messages in the same file point the same way: more incomplete-variable bailouts and a new `operatorEqVarError`. Cppcheck understands this code worse than before. ---- 33 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libofx/libofx_0.10.9.orig.tar.gz Result: your libofx-0.10.9/lib/tree.hh:487:36: warning:inconclusive: Member variable 'tree < OfxGenericContainer * , std :: allocator < tree_node_ < OfxGenericContainer * > > >::alloc_' is not assigned a value in 'tree < OfxGenericContainer * , std :: allocator < tree_node_ < OfxGenericContainer * > > >::operator='. [operatorEqVarError] Explanation: The new warning says `operator=` does not assign the member `alloc_`. `alloc_` is the tree's node allocator, here `std::allocator>`. That allocator is stateless, and standard allocators are deliberately not copied on assignment (`propagate_on_container_copy_assignment` is false). So `operator=` calling only `copy_(other)` is correct, and the warning is a false positive. It most likely appeared because the PR changed when the symbol database's need-initialization information is computed (it now runs later, in the new `finalize()` step). That makes the check treat the allocator member as something that must be copied. ---- 34 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libo/libofx/libofx_0.10.9.orig.tar.gz Result: your libofx-0.10.9/lib/tree.hh:527:0: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable pre_order_iterator [valueFlowBailoutIncompleteVar] Explanation: Line 527 in `tree::clear()` calls `erase(pre_order_iterator(head->next_sibling))`, where `pre_order_iterator` is a nested class of the `tree` template. With the PR, Cppcheck now treats `pre_order_iterator` as an incomplete variable rather than a type, so ValueFlow skips the whole function. This likely comes from the new type-deduction or incremental symbol database rebuild handling the deduced `erase` call or the instantiated class code badly. The new bailout, together with the other new bailouts and the new `operatorEqVarError` in the same file, shows Cppcheck understands this code worse than before. ---- 35 / 50 ---- Verdict: NEUTRAL (medium 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/test/filter_iterator/test.cxx:61:10: style: The member function 'FilterIteratorTests::test_filter_write_mod2 < int * , int * >' can be static. [functionStatic] vigra-Version-1-12-4/test/filter_iterator/test.cxx:61:10: note: The member function 'FilterIteratorTests::test_filter_write_mod2 < int * , int * >' can be static. vigra-Version-1-12-4/test/filter_iterator/test.cxx:61:10: note: The member function 'FilterIteratorTests::test_filter_write_mod2 < int * , int * >' can be static. Explanation: `test_filter_write_mod2` is a member function template that uses no members of `FilterIteratorTests`, so 'can be static' is a true positive both before and after the PR. The new type deduction now instantiates the call `test_filter_write_mod2(in, in+10, out_expected)` as ``. The same warning is still reported at the same line, but the message now names that instantiation instead of the template, and two redundant notes appear. Calls using vector iterators are not deduced. The finding and its location are unchanged; only the wording differs slightly, so the effect for users is essentially neutral. ---- 36 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mriconvert/mriconvert_2.1.0.orig.tar.gz Result: your ByteSwap.h:18:13: portability:inconclusive: Casting from float * to char * is not portable due to different binary data representations on different platforms. [invalidPointerCast] Explanation: The PR now deduces the template argument from a call like `ByteSwap(floatVar, 4)` and instantiates `ByteSwap`. That makes `reinterpret_cast(&rBuffer)` look like a `float*` to `char*` cast, which triggers the new inconclusive invalidPointerCast warning. Casting any object pointer to `char*` to access its bytes is explicitly allowed by the aliasing rules. Doing so is the intended, standard way to byte-swap, and the function is a generic byte-swapper whose purpose is to work on the binary representation. The warning is noise produced by the new instantiation, not a real portability problem, so it is effectively a false positive. ---- 37 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/m/mypy/mypy_2.4.0.orig.tar.gz Result: main mypy-2.4.0/mypyc/external/googletest/src/gtest-printers.cc:264:42: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CharType [valueFlowBailoutIncompleteVar] Explanation: `PrintCharsAsStringTo` is a function template. It is only called with deducible arguments: `begin` is `const char*` or `const wchar_t*`, passed through `UniversalPrintCharArray`, which in turn is called from non-template overloads. Before the PR, Cppcheck only deduced template arguments from literals. The template stayed uninstantiated, and ValueFlow bailed out on the incomplete `CharType`. With type-based deduction, the calls become `PrintCharsAsStringTo` and `PrintCharsAsStringTo`. The bodies are instantiated with concrete types and the generic template is removed, so the bailout disappears. Cppcheck now understands this code better, so losing the debug message is an improvement. ---- 38 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: main oce-OCE-0.18.3/test/gtest-1.7.0/src/gtest-printers.cc:257:42: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CharType [valueFlowBailoutIncompleteVar] Explanation: PrintCharsAsStringTo is only called with deduced arguments, e.g. PrintCharsAsStringTo(begin, len, os) where begin is a 'const CharType*' inside UniversalPrintCharArray. That function is in turn called with concrete const char*/const wchar_t* arrays. Before the PR only deduction from literals worked, so the template stayed uninstantiated. ValueFlow then hit the unknown 'CharType' in sizeof(CharType) and emitted the incomplete-variable bailout. With the new type-based deduction for 'const T*' parameters, the templates are instantiated with char/wchar_t. The generic body with the unresolved CharType is removed, so the bailout disappears because Cppcheck now understands the code better. ---- 39 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: main oce-OCE-0.18.3/test/gtest-1.7.0/test/gtest-printers_test.cc:237:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: `Print(const T&)` is a function template that was never instantiated before, because its calls (`Print(kEWP1)`, `Print(BiggestIntConvertible())`, ...) have non-literal arguments. ValueFlow therefore analysed the raw template body and bailed out on the incomplete variable `T`. The PR deduces template arguments from the argument types (enum, record, etc.), so `Print` is now instantiated with concrete types and the generic template is removed. The debug bailout disappears because Cppcheck now analyses concrete instantiations of the function body. ---- 40 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: main oce-OCE-0.18.3/test/gtest-1.7.0/test/gtest-printers_test.cc:247:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable T [valueFlowBailoutIncompleteVar] Explanation: `PrintByRef` is a function template taking `const T&`. It is called with variables and expressions elsewhere in the file. Before the PR, Cppcheck could not deduce `T` from non-literal arguments. The template stayed uninstantiated, and ValueFlow bailed out on the incomplete variable `T` in the generic body. The PR deduces template arguments from argument ValueTypes, and `const T&` is a supported parameter shape. So `PrintByRef` is now instantiated with concrete types and the generic template body is removed. The debug bailout disappears because Cppcheck now understands the code better, not because analysis was lost. ---- 41 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: main oce-OCE-0.18.3/test/gtest-1.7.0/test/gtest-printers_test.cc:968:8: style: struct member 'iterator::x' is never used. [unusedStructMember] Explanation: `struct iterator { char x; }` is a test fixture. It is value-initialized and passed to gtest's `Print(it)`. For a type that is not a container, gtest falls back to dumping the object's raw bytes (`reinterpret_cast(&value)`, `sizeof(value)`). The member `x` exists to give the object one defined, zero-initialized byte, which produces the expected "1-byte object <00>". So it is effectively used through raw memory access, and the unusedStructMember warning is a false positive in spirit. The PR now deduces template arguments from variable arguments such as `Print(it)`, so the gtest printer templates are instantiated with `iterator`. This most likely lets Cppcheck see the struct being used generically or through casts, and the check bails out. Dropping this style warning seems like a small improvement, though the exact mechanism cannot be confirmed from the snippet. ---- 42 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/o/oce/oce_0.18.3.orig.tar.gz Result: main oce-OCE-0.18.3/test/gtest-1.7.0/test/gtest-printers_test.cc:979:8: style: struct member 'const_iterator::x' is never used. [unusedStructMember] Explanation: `const_iterator::x` is never named, but it is not dead. It gives the struct its 1-byte size, and `Print(it)` dumps the object's raw bytes; the test expects "1-byte object <00>". So the member's storage is observed indirectly, and the warning is arguably a false positive. With the PR, `Print(it)` is deduced and instantiated as `Print`. Cppcheck then sees the struct object flowing into the generic printer and no longer reports the member. The same happened for `iterator::x`. Dropping it is reasonable, though one could also argue the member is technically never accessed by name. ---- 43 / 50 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/protobuf/protobuf_36.2.orig.tar.gz Result: your protobuf-36.2/conformance/binary_wireformat.h:257:54: performance: Function parameter 'content' should be passed by const reference. [passedByValue] Explanation: Before this PR, `LengthPrefixedField(fieldnum, wire)` calls were never instantiated, because the argument is not a literal. The PR's type deduction now instantiates the template with T deduced from the argument, most likely `Wire` (a class holding a byte string). The function only reads `content` and passes it to `LengthPrefixed(content)`, so taking it by value makes an unnecessary copy of a class object. Passing it as `const T&` would work for any class type used here. The new warning is therefore a reasonable true positive that the better template analysis exposes. ---- 44 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/p/pymol/pymol_3.1.0+dfsg.orig.tar.xz Result: your pymol-open-source-3.1.0/layer2/CoordSet.h:42: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 `struct CoordSet : CObjectState`. Main did not report it for the same code, so the base type was resolved before. The PR adds template type-deduction rounds that rebuild or incrementally update the symbol database and remove deferred template declarations. That process most likely leaves a type reference unresolved, here probably the base class `CObjectState`. A new debug message of this kind means Cppcheck understands the code worse, which can weaken later checks. ---- 45 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/p/pymol/pymol_3.1.0+dfsg.orig.tar.xz Result: your pymol-open-source-3.1.0/layer2/RepEllipsoid.cpp:152:17: style: The scope of the variable 'G' can be reduced. [variableScope] Explanation: `G` is initialized from `cs->G` at the top of `RepEllipsoidNew`. The visible uses (the `SettingGet_*` calls) are all inside the block that opens at line 167. Whether its scope can really be reduced depends on whether `G` is also used after that block, and that part of the function is not shown. Main did not warn, so main either saw a use outside the block or bailed out. The PR also adds a new 'SymbolDatabase couldn't resolve all user defined types' debug message for CoordSet.h in this package. That hints the template deduction and incremental symbol-database rebuild may have changed how this code is understood, possibly losing a use of `G`. Without the rest of the function, the warning cannot be confirmed as right or wrong. ---- 46 / 50 ---- Verdict: REGRESSION (medium confidence) Package: https://ftp.debian.org/debian/pool/main/q/qd/qd_2.3.23+dfsg.1.orig.tar.xz Result: your qd-2.3.23+dfsg.1/tests/quadt_test.cpp:164:20: style: Parameter 's' can be declared as pointer to const [constParameterPointer] Explanation: Line 164 is an explicit specialization `template <> void convert(char *s, double *x)` of the primary template `template void convert(char *s, T *x)`. The PR's type deduction now instantiates `convert` from the call `convert(s, &coeff[i])` and turns the specialization into a normal function, so constParameterPointer now analyses it. The specialization body only reads `s`. However, its parameter list must match the primary template's `char *`, so changing only this function to `const char *` would no longer be a valid specialization. The user would have to change the primary template and every other instantiation too. Cppcheck normally avoids this warning when a function signature is fixed by something else (templates, overrides). The new warning is therefore misleading, most likely a false positive introduced by the specialization being treated as an ordinary function. ---- 47 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/simutrans/simutrans_124.5.orig.tar.gz Result: your simutrans-124.5/src/simutrans/display/simgraph.h:197:13: debug: Scope::checkVariable found variable 'get_screen_size' with varid 0. [varid0] Explanation: Line 197 declares an ordinary function pointer member, `scr_size (*get_screen_size)();`. Main did not report it. With the PR, the symbol database reports this variable with varid 0. This happens around struct-returning function pointer members (scr_rect, scr_size), so it looks like the PR's new code for re-assigning variable ids and updating the symbol database after template deduction mishandles these declarations. A new varid0 debug message on valid code means Cppcheck now understands the code worse. ---- 48 / 50 ---- Verdict: REGRESSION (high confidence) Package: https://ftp.debian.org/debian/pool/main/s/simutrans/simutrans_124.5.orig.tar.gz Result: your simutrans-124.5/src/simutrans/display/simgraph.h:315:13: debug: Scope::checkVariable found variable 'calc_multiline_text_size' with varid 0. [varid0] Explanation: Line 315 declares a member function pointer `scr_size (*calc_multiline_text_size)(const char *text);` in a struct. It is an ordinary variable and should get a varid. The new varid0 debug message appears only with the PR. Its incremental setVarId/symbol database update after template deduction leaves this member variable token without a varid, which Cppcheck did not do before. The new debug messages on other function-pointer members in the same header confirm the pattern. Cppcheck now understands this code worse. ---- 49 / 50 ---- Verdict: UNCLEAR (low confidence) Package: https://ftp.debian.org/debian/pool/main/s/simutrans/simutrans_124.5.orig.tar.gz Result: your simutrans-124.5/src/simutrans/script/script.h:245:47: style: Parameter 'ret' can be declared as reference to const [constParameterReference] Explanation: The new warning appears because the PR now deduces `R` from a variable argument and instantiates `tell_return_value`. The const check then runs on that concrete instantiation. In the shown code, `ret` is only passed to `script_api::param::push(vm, ret)`. Whether `const R&` is valid depends on the signature of every `param::push` specialization used with this template, and those are not shown. If they all take `T const&`, the suggestion is technically correct. If some specialization takes a non-const reference, it is a false positive that comes from judging the template by one instantiation. The source shown is not enough to decide. ---- 50 / 50 ---- Verdict: IMPROVEMENT (low confidence) Package: https://ftp.debian.org/debian/pool/main/s/simutrans/simutrans_124.5.orig.tar.gz Result: your simutrans-124.5/src/simutrans/tpl/weighted_vector_tpl.h:395:80: style:inconclusive: Function 'swap < koord >' argument 2 names different: declaration '' definition 'b'. [funcArgNamesDifferentUnnamed] Explanation: The friend declaration `friend void swap<>(weighted_vector_tpl&, weighted_vector_tpl&);` leaves the parameters unnamed. The definition at line 395 names them `a` and `b`. That is exactly the case funcArgNamesDifferentUnnamed is meant to report; the same check fires elsewhere in this package (wegbauer.cc). The PR's type deduction now instantiates `swap` from calls like `swap(x, y)`, so the template body is checked and the mismatch is found. The finding is a true positive for this inconclusive style check. Drawbacks: it is reported once per instantiation (`swap` and `swap`) at the same template line, and some users may consider unnamed friend parameters harmless. Low confidence.