From d95d10a627491803396ffbd9a8bc02315f1b8adc Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 6 Jul 2026 10:58:01 +0200 Subject: [PATCH 1/2] Update checkother.cpp --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 51124c45d1c..ef6fb9003b1 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2408,7 +2408,7 @@ void CheckOtherImpl::checkIncompleteStatement() !(tok->str() == "," && tok->astParent() && tok->astParent()->isAssignmentOp())) continue; // Skip statement expressions - if (Token::simpleMatch(rtok, "; } )")) + if (Token::simpleMatch(rtok, "; } )") || Token::simpleMatch(tok->next(), "; } )")) continue; if (!isConstStatement(tok, mSettings.library, false)) continue; From c5c9435700a0fa38315461c976873b51136bad04 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 6 Jul 2026 10:59:02 +0200 Subject: [PATCH 2/2] Update testincompletestatement.cpp --- test/testincompletestatement.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index b72b6524872..806f734274e 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -758,6 +758,11 @@ class TestIncompleteStatement : public TestFixture { "}\n"); ASSERT_EQUALS("[test.cpp:4:6]: (warning) Redundant code: Found unused array access. [constStatement]\n", errout_str()); + + check("int f(int i) {\n" // #14889 + " return i ? 8 : ({ int x = 2; x; });\n" + "}\n"); + ASSERT_EQUALS("", errout_str()); } void vardecl() {