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

Method funcnameInParenthesis2

test/testtokenize.cpp:8940–8953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8938 }
8939
8940 void funcnameInParenthesis2() { // #13578
8941 const char code[] = "int f(double a, double b, double c) {\n"
8942 " return static_cast<int>(std::ceil((std::min)(a, (std::min)(b, c))));\n"
8943 "}\n";
8944 SimpleTokenizer tokenizer(settings1, *this);
8945 ASSERT_LOC(tokenizer.tokenize(code), __FILE__, __LINE__);
8946 const Token *f = Token::findsimplematch(tokenizer.tokens(), "min");
8947 ASSERT(f);
8948 const Token *par = f->next();
8949 ASSERT(par);
8950 ASSERT(Token::simpleMatch(par, "("));
8951 ASSERT_EQUALS(par->astOperand1(), f->astParent() /* :: */);
8952 ASSERT(Token::simpleMatch(par->astOperand2(), ","));
8953 }
8954
8955 void funcnameInParenthesis3() { // #13585
8956 const char code[] = "int f(int a, int b) {\n"

Callers

nothing calls this directly

Calls 7

findsimplematchFunction · 0.85
tokenizeMethod · 0.80
nextMethod · 0.80
astOperand1Method · 0.80
astParentMethod · 0.80
astOperand2Method · 0.80
simpleMatchFunction · 0.50

Tested by

no test coverage detected