From c809367c20151240240df331de28d7dc3c4cef05 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 26 Jan 2026 11:02:22 +0100 Subject: [PATCH 1/2] Update astutils.cpp --- lib/astutils.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 922c734511a..41512d64c59 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -3091,8 +3091,6 @@ static const Token* findExpressionChangedImpl(const Token* expr, } bool global = false; if (tok->variable()) { - if (tok->variable()->isConst()) - return false; global = !tok->variable()->isLocal() && !tok->variable()->isArgument() && !(tok->variable()->isMember() && !tok->variable()->isStatic()); } else if (tok->isIncompleteVar() && !tok->isIncompleteConstant()) { From 27cad4839e9f4b8c511e935cf728770a6c782b89 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 26 Jan 2026 11:06:36 +0100 Subject: [PATCH 2/2] Update testcondition.cpp --- test/testcondition.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index d1ec9b1e17a..21882c1989a 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -5882,6 +5882,17 @@ class TestCondition : public TestFixture { " if (strlen(s2) > 0) {}\n" "}\n"); ASSERT_EQUALS("", errout_str()); + + check("void g(int*);\n" // #14428 + "int f(int* const p) {\n" + " int i = 0;\n" + " if (*p == 0)\n" + " g(p);\n" + " if (*p == 0)\n" + " i = 1;\n" + " return i;\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); } void checkInvalidTestForOverflow() {