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

Method functionArgs21

test/testsymboldatabase.cpp:3062–3082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3060 }
3061
3062 void functionArgs21() {
3063 const char code[] = "void f(std::vector<int>::size_type) {}\n" // #11408
3064 "template<typename T>\n"
3065 "struct S { using t = int; };\n"
3066 "template<typename T>\n"
3067 "S<T> operator+(const S<T>&lhs, typename S<T>::t) { return lhs; }";
3068 GET_SYMBOL_DB(code);
3069 ASSERT(db != nullptr);
3070 auto it = db->functionScopes.begin();
3071 const Function *func = (*it)->function;
3072 ASSERT_EQUALS("f", func->name());
3073 ASSERT_EQUALS(1, func->argCount());
3074 const Variable* arg = func->getArgumentVar(0);
3075 ASSERT_EQUALS("", arg->name());
3076 ++it;
3077 func = (*it)->function;
3078 ASSERT_EQUALS("operator+", func->name());
3079 ASSERT_EQUALS(2, func->argCount());
3080 arg = func->getArgumentVar(1);
3081 ASSERT_EQUALS("", arg->name());
3082 }
3083
3084 void functionArgs22() {
3085 const char code[] = "typedef void (*callback_fn)(void);\n"

Callers

nothing calls this directly

Calls 3

getArgumentVarMethod · 0.80
beginMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected