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

Method funcnameInParenthesis3

test/testtokenize.cpp:8955–8968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8953 }
8954
8955 void funcnameInParenthesis3() { // #13585
8956 const char code[] = "int f(int a, int b) {\n"
8957 " return (a != 0) ? 1 : (std::min)(1, b);\n"
8958 "}\n";
8959 SimpleTokenizer tokenizer(settings1, *this);
8960 ASSERT_LOC(tokenizer.tokenize(code), __FILE__, __LINE__);
8961 const Token *f = Token::findsimplematch(tokenizer.tokens(), "min");
8962 ASSERT(f);
8963 const Token *par = f->next();
8964 ASSERT(par);
8965 ASSERT(Token::simpleMatch(par, "("));
8966 ASSERT_EQUALS(par->astOperand1(), f->astParent() /* :: */);
8967 ASSERT(Token::simpleMatch(par->astOperand2(), ","));
8968 }
8969
8970 void genericInIf() { // #13561
8971 const char code[] = " if (_Generic(s, char * : 1, const float * : (a ? b, c : d), volatile int * : 3, default : 0)) {}";

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