Skip to content

Commit a75525e

Browse files
Update testsymboldatabase.cpp
1 parent 46221b9 commit a75525e

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/testsymboldatabase.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ class TestSymbolDatabase : public TestFixture {
546546
TEST_CASE(findFunction62); // #14272 - pointer passed to function is const
547547
TEST_CASE(findFunction63); // #14937 - member function of type returned by operator()
548548
TEST_CASE(findFunction64); // overloaded operator()
549+
TEST_CASE(findFunction65);
549550
TEST_CASE(findFunctionRef1);
550551
TEST_CASE(findFunctionRef2); // #13328
551552
TEST_CASE(findFunctionContainer);
@@ -8990,6 +8991,20 @@ class TestSymbolDatabase : public TestFixture {
89908991
}
89918992
}
89928993

8994+
void findFunction65()
8995+
{
8996+
{
8997+
GET_SYMBOL_DB("bool g(char) { return true; }\n" // #15033
8998+
"bool g(int) { return false; }\n"
8999+
"void f(char c) {\n"
9000+
" if (g(+c)) {}\n"
9001+
"}\n");
9002+
const Token* g = Token::findsimplematch(tokenizer.tokens(), "g ( +");
9003+
ASSERT(g && g->function());
9004+
ASSERT_EQUALS(2, g->function()->tokenDef->linenr());
9005+
}
9006+
}
9007+
89939008
void findFunctionRef1() {
89949009
GET_SYMBOL_DB("struct X {\n"
89959010
" const std::vector<int> getInts() const & { return mInts; }\n"

0 commit comments

Comments
 (0)