AI review of 2026-10-26_12-15-08-c10d38f45519-results.txt PR: #8955 https://github.com/cppcheck-opensource/cppcheck/pull/8955 Tested: c10d38f455197c978d78580dd60ab6f805bdd615 Merge base: 78a38ed5d57dbadcc188ea0204d5c9d1d6b6197c Reviewed: 2026-10-31 08:27:14 UTC Model: claude-opus-5-5 (effort high) Results: 10 reviewed of 10 in the report, the test is still running (500 analysed of 1000 requested packages) Verdicts: 10 improvement Tokens: 35115 input, 17451 cache read, 1939 cache write, 4510 output The verdicts are written by AI and can be wrong. ---- 1 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: main libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:101:30: error: syntax error: keyword 'try' is not allowed in class/struct/union/enum scope [syntaxError] Explanation: Line 101 uses a valid function-try-block on a destructor with the virt-specifier: `~CatchDerived() override try {} catch (...) {}`. Main did not handle `override` before `try`, so it raised a false syntaxError and gave up on the file. The PR walks back past `override` and simplifies the function-try-block correctly. This removes the false syntax error and lets the file be analyzed. ---- 2 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:49:6: style: The destructor '~NoExSpecDerived' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:49:6: note: Destructor in derived class Explanation: The PR fixes the parsing of function-try-blocks after 'override'. Main stopped with a syntaxError at line 101, so the whole file went unanalyzed. Now the file is checked. Line 49 declares an empty '~NoExSpecDerived() override {}' that overrides VirtualBase's empty virtual destructor, so it adds nothing. The file's own comment marks it as an expected 'unnecessary user-declared destructor'. The new warning is a true positive, and the false syntax error is gone. ---- 3 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:53:6: style: The destructor '~NoThrowDerived' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:53:6: note: Destructor in derived class Explanation: On main, the `try` at line 101 (a function-try-block after `override`) caused a syntaxError, so Cppcheck skipped the whole file. The PR makes simplifyFunctionTryCatch handle `override`/`final` before `try`, so the file is now analyzed. At line 53, `~NoThrowDerived() throw () override {}` is an empty destructor overriding the empty virtual base destructor. It adds nothing over the implicit destructor, and the LibreOffice plugin test itself marks it as `expected-error ... unnecessary user-declared destructor`. This is a newly found true positive. ---- 4 / 10 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:57:6: style: The destructor '~NoexceptDerived' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:57:6: note: Destructor in derived class Explanation: Before the PR, Cppcheck stopped on this file with a syntax error at line 101, where a function-try-block follows `override`. The PR teaches the tokenizer to handle that, so the whole file is now analyzed. Line 57 declares `~NoexceptDerived() noexcept override {}`, an empty destructor overriding the virtual destructor of VirtualBase. VirtualBase's destructor (hxx:17) is presumably also empty, since Cppcheck reports the two as identical. That makes the derived destructor redundant. The test file itself expects the loplugin to flag it as an 'unnecessary user-declared destructor'. The new warning is therefore a true positive that appears because Cppcheck now parses the file correctly. ---- 5 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:61:6: style: The destructor '~NoexceptTrueDerived' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:61:6: note: Destructor in derived class Explanation: The PR now handles `~CatchDerived() override try {} catch (...) {}` at line 101, which used to cause a false syntax error that stopped analysis of the whole file. With the file analyzed, Cppcheck reports that `~NoexceptTrueDerived() noexcept(true) override {}` is an empty destructor overriding the empty virtual destructor in VirtualBase. That is a genuinely redundant user-declared destructor, and the loplugin test itself marks this line with 'unnecessary user-declared destructor'. So this is a new true positive. ---- 6 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:87:6: style: The destructor '~EmptyDerived1' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:87:6: note: Destructor in derived class Explanation: On main, the function-try-block destructor `~CatchDerived() override try {} catch (...) {}` at line 101 caused a syntaxError, so Cppcheck did not analyze the file at all. The PR now recognizes `override try` as a function head, so the file is parsed and checked. `~EmptyDerived1() override {}` has an empty body. The base destructor in the .hxx (line 17) is also empty, so the override really is redundant. The source even marks it with `expected-error {{unnecessary user-declared destructor}}`. This is a newly found true positive. ---- 7 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:91:6: style: The destructor '~EmptyDerived2' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:91:6: note: Destructor in derived class Explanation: Before the PR, Cppcheck stopped on this file with a syntaxError at line 101, where `~CatchDerived() override try {} catch (...) {}` uses a function-try-block after `override`. The PR teaches the tokenizer to handle that form, so the whole file is now analyzed. `~EmptyDerived2()` is declared `override` and defined out of line with an empty body, `EmptyDerived2::~EmptyDerived2() {}`. That matches the empty virtual destructor of `VirtualBase` (the base-class destructor noted at hxx:17), so the destructor really is a useless override. The test file itself marks it as an expected 'unnecessary user-declared destructor' diagnostic. This is a new true positive made possible by better parsing. ---- 8 / 10 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.cxx:97:35: warning: Redundant code: Found unused cast in expression '(void)0'. [constStatement] Explanation: Main stopped analyzing this file with a syntaxError on line 101 (`~CatchDerived() override try {} catch (...) {}`). The PR now handles a function-try-block after `override`, so the file is parsed and checked. Line 97 contains `{ (void) 0; }`, a statement that really does nothing, so the constStatement warning is technically correct. It is intentional filler in a compiler-plugin test, but the newly reported warning comes from Cppcheck understanding the code better. ---- 9 / 10 ---- Verdict: IMPROVEMENT (high confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:21:6: style: The destructor '~IncludedDerived1' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:21:6: note: Destructor in derived class Explanation: The PR fixes handling of function-try-blocks after `override`/`final`. Before, main hit a syntax error at line 101 of the .cxx file and stopped analyzing the file, so no other checks ran. Now the file is analyzed. At line 21, `~IncludedDerived1() override {}` is an empty destructor overriding the empty virtual destructor `~VirtualBase() {}`. It really is identical to the base destructor, and the file's own expected-error comment flags it as unnecessary. This is a true positive that was gained because Cppcheck now understands the code. ---- 10 / 10 ---- Verdict: IMPROVEMENT (medium confidence) Package: https://ftp.debian.org/debian/pool/main/libr/libreoffice/libreoffice_26.8.2.2.orig.tar.xz Result: your libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:25:6: style: The destructor '~IncludedDerived2' overrides a destructor in a base class but is identical to the overridden function [uselessOverride] libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:17:14: note: Virtual destructor in base class libreoffice-26.8.2.2/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx:25:6: note: Destructor in derived class Explanation: Before the PR, main stopped on this file with a syntax error at line 101 of the .cxx. That line is most likely a destructor written as `~X() override try {...}`, which the PR now parses, so the whole file is analysed. `IncludedDerived2` declares `~IncludedDerived2() override;` and overrides `VirtualBase`'s empty virtual destructor. This LibreOffice test file defines such destructors with empty bodies and marks them `expected-error` for 'unnecessary user-declared destructor'. The new uselessOverride warning therefore describes a genuinely redundant destructor, so it is a true positive.