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

Method functionArgs8

test/testsymboldatabase.cpp:2832–2848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2830 }
2831
2832 void functionArgs8() { // #7653
2833 GET_SYMBOL_DB("struct A { int i; };\n"
2834 "struct B { double d; };\n"
2835 "int foo(struct A a);\n"
2836 "double foo(struct B b);\n"
2837 "void bar() {\n"
2838 " struct B b;\n"
2839 " foo(b);\n"
2840 "}");
2841 ASSERT_EQUALS(true, db != nullptr);
2842 const Token *f = Token::findsimplematch(tokenizer.tokens(), "foo ( b");
2843 ASSERT_EQUALS(true, f && f->function());
2844 const Function *func = f->function();
2845 ASSERT_EQUALS(true, func->tokenDef->linenr() == 4 && func->argumentList.size() == 1 && func->argumentList.front().type());
2846 const Type * type = func->argumentList.front().type();
2847 ASSERT_EQUALS(true, type->isStructType());
2848 }
2849
2850 void functionArgs9() { // #7657
2851 GET_SYMBOL_DB("struct A {\n"

Callers

nothing calls this directly

Calls 6

findsimplematchFunction · 0.85
typeMethod · 0.80
frontMethod · 0.80
isStructTypeMethod · 0.80
functionMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected