File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -6430,7 +6430,7 @@ const Function* SymbolDatabase::findFunction(const Token* const tok) const
64306430 }
64316431 }
64326432 // Check for constructor
6433- if (Token::Match (tok, " %name% (|{" )) {
6433+ if (! Token::simpleMatch (tok-> tokAt (- 2 ), " this . " ) && Token::Match (tok, " %name% (|{" )) {
64346434 ValueType vt = ValueType::parseDecl (tok, mSettings );
64356435 if (vt.typeScope )
64366436 return vt.typeScope ->findFunction (tok, false );
Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ class TestClass : public TestFixture {
195195 TEST_CASE (const98);
196196 TEST_CASE (const99);
197197 TEST_CASE (const100);
198+ TEST_CASE (const101);
198199
199200 TEST_CASE (const_handleDefaultParameters);
200201 TEST_CASE (const_passThisToMemberOfOtherClass);
@@ -6972,6 +6973,16 @@ class TestClass : public TestFixture {
69726973 ASSERT_EQUALS (" " , errout_str ()); // don't crash
69736974 }
69746975
6976+ void const101 () {
6977+ checkConst (" struct error {\n "
6978+ " error() = default;\n "
6979+ " };\n "
6980+ " struct S : U {\n "
6981+ " int f() { return this->error(); }\n "
6982+ " };\n " );
6983+ ASSERT_EQUALS (" " , errout_str ());
6984+ }
6985+
69756986 void const_handleDefaultParameters () {
69766987 checkConst (" struct Foo {\n "
69776988 " void foo1(int i, int j = 0) {\n "
You can’t perform that action at this time.
0 commit comments