MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / findFunction22

Method findFunction22

test/testsymboldatabase.cpp:7934–7951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7932 }
7933
7934 void findFunction22() { // # 8558
7935 GET_SYMBOL_DB("struct foo {\n"
7936 " int GetThing( ) const { return m_thing; }\n"
7937 " int* GetThing( ) { return &m_thing; }\n"
7938 "};\n"
7939 "\n"
7940 "void f(const foo *myFoo) {\n"
7941 " int* myThing = myFoo->GetThing();\n"
7942 "}");
7943
7944 ASSERT(db != nullptr);
7945
7946 const Token *tok1 = Token::findsimplematch(tokenizer.tokens(), ". GetThing ( ) ;")->next();
7947
7948 const Function *f = tok1 ? tok1->function() : nullptr;
7949 ASSERT(f != nullptr);
7950 ASSERT_EQUALS(true, f && f->isConst());
7951 }
7952
7953 void findFunction23() { // # 8558
7954 GET_SYMBOL_DB("struct foo {\n"

Callers

nothing calls this directly

Calls 4

findsimplematchFunction · 0.85
nextMethod · 0.80
isConstMethod · 0.80
functionMethod · 0.45

Tested by

no test coverage detected