@@ -287,6 +287,7 @@ class TestSymbolDatabase: public TestFixture {
287287 TEST_CASE (findFunction15);
288288 TEST_CASE (findFunction16);
289289 TEST_CASE (findFunction17);
290+ TEST_CASE (findFunction18);
290291
291292 TEST_CASE (noexceptFunction1);
292293 TEST_CASE (noexceptFunction2);
@@ -3785,6 +3786,22 @@ class TestSymbolDatabase: public TestFixture {
37853786 ASSERT_EQUALS (true , f && f->function () && f->function ()->tokenDef ->linenr () == 2 );
37863787 }
37873788
3789+ void findFunction18 () {
3790+ GET_SYMBOL_DB (" class Fred {\n "
3791+ " void f(int i) { }\n "
3792+ " void f(float f) const { }\n "
3793+ " void a() { f(1); }\n "
3794+ " void b() { f(1.f); }\n "
3795+ " };" );
3796+
3797+ ASSERT_EQUALS (" " , errout.str ());
3798+
3799+ const Token *f = Token::findsimplematch (tokenizer.tokens (), " f ( 1 ) ;" );
3800+ ASSERT_EQUALS (true , db && f && f->function () && f->function ()->tokenDef ->linenr () == 2 );
3801+
3802+ f = Token::findsimplematch (tokenizer.tokens (), " f ( 1.f ) ;" );
3803+ ASSERT_EQUALS (true , f && f->function () && f->function ()->tokenDef ->linenr () == 3 );
3804+ }
37883805
37893806#define FUNC (x ) const Function *x = findFunctionByName(#x, &db->scopeList.front()); \
37903807 ASSERT_EQUALS (true , x != nullptr ); \
0 commit comments