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

Method isFunction2

test/testsymboldatabase.cpp:7120–7137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7118 }
7119
7120 void isFunction2() {
7121 GET_SYMBOL_DB("void set_cur_cpu_spec()\n"
7122 "{\n"
7123 " t = PTRRELOC(t);\n"
7124 "}\n"
7125 "\n"
7126 "cpu_spec * __init setup_cpu_spec()\n"
7127 "{\n"
7128 " t = PTRRELOC(t);\n"
7129 " *PTRRELOC(&x) = &y;\n"
7130 "}");
7131 ASSERT(db != nullptr);
7132 const Token *funcStart, *argStart, *declEnd;
7133 ASSERT(db && !db->isFunction(Token::findsimplematch(tokenizer.tokens(), "PTRRELOC ( &"), &db->scopeList.back(), funcStart, argStart, declEnd));
7134 ASSERT(db->findScopeByName("set_cur_cpu_spec") != nullptr);
7135 ASSERT(db->findScopeByName("setup_cpu_spec") != nullptr);
7136 ASSERT(db->findScopeByName("PTRRELOC") == nullptr);
7137 }
7138
7139 void isFunction3() {
7140 GET_SYMBOL_DB("std::vector<int>&& f(std::vector<int>& v) {\n"

Callers

nothing calls this directly

Calls 3

findsimplematchFunction · 0.85
findScopeByNameMethod · 0.80
isFunctionMethod · 0.45

Tested by

no test coverage detected