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

Method functionArgs16

test/testsymboldatabase.cpp:2982–2995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2980 }
2981
2982 void functionArgs16() { // #9591
2983 const char code[] =
2984 "struct A { int var; };\n"
2985 "void foo(int x, decltype(A::var) *&p) {}";
2986 GET_SYMBOL_DB(code);
2987 ASSERT(db);
2988 const Scope *scope = db->functionScopes.front();
2989 const Function *func = scope->function;
2990 ASSERT_EQUALS(2, func->argCount());
2991 const Variable *arg2 = func->getArgumentVar(1);
2992 ASSERT_EQUALS("p", arg2->name());
2993 ASSERT(arg2->isPointer());
2994 ASSERT(arg2->isReference());
2995 }
2996
2997 void functionArgs17() {
2998 const char code[] = "void f(int (*fp)(), int x, int y) {}";

Callers

nothing calls this directly

Calls 3

frontMethod · 0.80
getArgumentVarMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected