From fb177b148b466a37e186d34bd448fb096cb434c6 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:47:31 +0100 Subject: [PATCH 1/2] Update valueflow.cpp --- lib/valueflow.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 7f4cd5584e8..e26bcb0c439 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -7612,8 +7612,6 @@ const ValueFlow::Value* ValueFlow::findValue(const std::list& if (ret) { if (ret->isInconclusive() && !settings.certainty.isEnabled(Certainty::inconclusive)) return nullptr; - if (ret->condition && !settings.severity.isEnabled(Severity::warning)) - return nullptr; } return ret; } From c510f586ac8a7d52442dd4ef0600f6274bb9e1de Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Tue, 17 Nov 2026 15:49:49 +0100 Subject: [PATCH 2/2] Update testother.cpp --- test/testother.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index d6025e9a640..cbeca3ed72b 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -10603,6 +10603,13 @@ class TestOther : public TestFixture { " return f<-1>(2)\n" "}\n"); ASSERT_EQUALS("", errout_str()); + + Settings settings = settingsBuilder(settings0).severity(Severity::portability).build(); + check("int f(int k, int& s) {\n" // #7215 + " if (k >= -128 && k <= 127)\n" + " s = (k << 8);\n" + "}\n", dinit(CheckOptions, $.settings = &settings)); + ASSERT_EQUALS("[test.cpp:2:11] -> [test.cpp:3:16]: (portability) Shifting a negative value is technically undefined behaviour [shiftNegativeLHS]\n", errout_str()); } void checkNegativeShiftErrorPath() {