From 8d3408085b8783e6595b9ff57e77a7ada66cd030 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 27 Apr 2026 08:34:54 +0200 Subject: [PATCH 1/2] Update symboldatabase.cpp --- lib/symboldatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 9b42b799405..c0af3ff723b 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1203,7 +1203,7 @@ void SymbolDatabase::createSymbolDatabaseSetFunctionPointers(bool firstPass) tok->function(function); - if (tok->strAt(1) != "(") + if (!function->isConstructor() && tok->strAt(1) != "(") const_cast(function)->functionPointerUsage = tok; } } From 5a3582e3d1077c92dfcd23148b174215a65343a9 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Mon, 27 Apr 2026 08:38:23 +0200 Subject: [PATCH 2/2] Update testother.cpp --- test/testother.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 54676cc6814..bb266e3074d 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -4150,6 +4150,16 @@ class TestOther : public TestFixture { " S s2{ cb };\n" "}\n"); ASSERT_EQUALS("[test.cpp:6:11] -> [test.cpp:2:21]: (performance) Function parameter 's' should be passed by const reference. However it seems that 'cb' is a callback function. [passedByValueCallback]\n", errout_str()); + + check("struct S {\n" // #14696 + " explicit S(std::string s = {}) {}\n" + "};\n" + "struct T {\n" + " explicit T(std::string* s = {}) {}\n" + "};\n"); + ASSERT_EQUALS("[test.cpp:2:28]: (performance) Function parameter 's' should be passed by const reference. [passedByValue]\n" + "[test.cpp:5:29]: (style) Parameter 's' can be declared as pointer to const [constParameterPointer]\n", + errout_str()); } void constPointer() {