From 54903628c8b0df7510d6048e962887a53fe13b08 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 8 Oct 2026 09:31:55 +0200 Subject: [PATCH 1/4] Add test for #14736 --- .../fuzz-crash_c/crash-3be27d29a1cc703716c646e3cfdf21cc896654fa | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/cli/fuzz-crash_c/crash-3be27d29a1cc703716c646e3cfdf21cc896654fa diff --git a/test/cli/fuzz-crash_c/crash-3be27d29a1cc703716c646e3cfdf21cc896654fa b/test/cli/fuzz-crash_c/crash-3be27d29a1cc703716c646e3cfdf21cc896654fa new file mode 100644 index 00000000000..e999e558f64 --- /dev/null +++ b/test/cli/fuzz-crash_c/crash-3be27d29a1cc703716c646e3cfdf21cc896654fa @@ -0,0 +1 @@ +i(){!:!=!!?:1} From 73c9967c21e7bcca428d398ca4dc6a46d7661613 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 8 Oct 2026 09:33:41 +0200 Subject: [PATCH 2/4] Add test for #11583 --- test/teststl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/teststl.cpp b/test/teststl.cpp index d902bfa17ba..3297915ce68 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -7078,6 +7078,18 @@ class TestStl : public TestFixture { dinit(CheckOptions, $.inconclusive = true)); ASSERT_EQUALS("", errout_str()); + check("template\n" // #11583 + "int g() { return 0; }\n" + "void f() {\n" + " std::vector v(1);\n" + " auto itr = v.begin() + g();\n" + " std::vector v2(itr, v.end());\n" + " v.erase(itr, v.end());\n" + " v.push_back(v2.size());\n" + "}\n", + dinit(CheckOptions, $.inconclusive = true)); + ASSERT_EQUALS("", errout_str()); + // #13410 check("int f(std::vector& v) {\n" " const int* i = &*v.cbegin();\n" From b8991ba6332bd311df4c5cd10cc73f4412587c4e Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 8 Oct 2026 09:34:42 +0200 Subject: [PATCH 3/4] Add test for #9981 --- test/testclass.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testclass.cpp b/test/testclass.cpp index 37dd28647a0..96344e4b5f9 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -7028,6 +7028,18 @@ class TestClass : public TestFixture { " }\n" "};\n"); ASSERT_EQUALS("", errout_str()); + + checkConst("struct A {\n" // #9981 + " int a = 0;\n" + " auto operator[](int x) -> int& {\n" + " a = 1;\n" + " return a;\n" + " }\n" + " int f() {\n" + " return (*this)[0];\n" + " }\n" + "};\n"); + ASSERT_EQUALS("", errout_str()); } void const102() { From e2a000c76ab8eb9da3f66b8024695645787b0dbd Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 8 Oct 2026 09:35:51 +0200 Subject: [PATCH 4/4] Add test for #12436 --- test/testother.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 951a9737f16..62824c16b36 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -12999,6 +12999,16 @@ class TestOther : public TestFixture { "}\n"); ASSERT_EQUALS("[test.cpp:4:9]: (warning) Access of moved variable 'p'. [accessMoved]\n" "[test.cpp:5:9]: (warning) Access of moved variable 'p'. [accessMoved]\n", errout_str()); + + check("void h(std::unique_ptr);\n" // #12436 + "void g(int);\n" + "void f() {\n" + " std::unique_ptr p = std::make_unique(5);\n" + " int* w = p.get();\n" + " h(std::move(p));\n" + " g(*w);\n" + "}\n"); + ASSERT_EQUALS("[test.cpp:5:10]: (style) Variable 'w' can be declared as pointer to const [constVariablePointer]\n", errout_str()); } void moveAndAddressOf() {