@@ -535,6 +535,7 @@ class TestSymbolDatabase : public TestFixture {
535535 TEST_CASE(findFunction59);
536536 TEST_CASE(findFunction60);
537537 TEST_CASE(findFunction61);
538+ TEST_CASE(findFunction62); // #14272 - pointer passed to function is const
538539 TEST_CASE(findFunctionRef1);
539540 TEST_CASE(findFunctionRef2); // #13328
540541 TEST_CASE(findFunctionContainer);
@@ -8694,6 +8695,22 @@ class TestSymbolDatabase : public TestFixture {
86948695 ASSERT(fun && !fun->function());
86958696 }
86968697
8698+ void findFunction62() { // #14272
8699+ GET_SYMBOL_DB("class Token {\n"
8700+ " std::string stringifyList(const Token* end, bool attributes = true) const;\n"
8701+ " std::string stringifyList(bool varid = false) const;\n"
8702+ "};\n"
8703+ "\n"
8704+ "void foo(const Token * const tokIf) {\n"
8705+ " tokIf->stringifyList(tokIf);\n"
8706+ "}\n");
8707+ const Token* functionCall = Token::findsimplematch(tokenizer.tokens(), "stringifyList ( tokIf )");
8708+ ASSERT(functionCall);
8709+ ASSERT(functionCall->function());
8710+ ASSERT(functionCall->function()->token);
8711+ ASSERT_EQUALS(2, functionCall->function()->token->linenr());
8712+ }
8713+
86978714 void findFunctionRef1() {
86988715 GET_SYMBOL_DB("struct X {\n"
86998716 " const std::vector<int> getInts() const & { return mInts; }\n"
0 commit comments