This commit is contained in:
parent
7881b99547
commit
809430631f
|
@ -3843,10 +3843,10 @@ void Tokenizer::setVarId()
|
|||
tok->varId(0);
|
||||
}
|
||||
|
||||
setPodTypes();
|
||||
|
||||
setVarIdPass1();
|
||||
|
||||
setPodTypes();
|
||||
|
||||
setVarIdPass2();
|
||||
}
|
||||
|
||||
|
@ -4144,7 +4144,7 @@ void Tokenizer::setVarIdPass1()
|
|||
}
|
||||
}
|
||||
|
||||
if (tok->isName() && !tok->isKeyword()) {
|
||||
if (tok->isName() && !tok->isKeyword() && !tok->isStandardType()) {
|
||||
// don't set variable id after a struct|enum|union
|
||||
if (Token::Match(tok->previous(), "struct|enum|union") || (isCPP() && tok->strAt(-1) == "class"))
|
||||
continue;
|
||||
|
@ -9588,7 +9588,7 @@ void Tokenizer::setPodTypes()
|
|||
if (!mSettings)
|
||||
return;
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (!tok->isName())
|
||||
if (!tok->isName() || tok->varId())
|
||||
continue;
|
||||
|
||||
// pod type
|
||||
|
|
|
@ -3015,6 +3015,9 @@ private:
|
|||
"2: char * text@1 ;\n"
|
||||
"3: void ( * f@2 ) ( int ( * arg ) ( char * ) ) ;\n"
|
||||
"4: }\n", tokenize(code2));
|
||||
|
||||
const char code3[] = "void f (void (*g) (int i, IN int n)) {}\n";
|
||||
ASSERT_EQUALS("1: void f ( void ( * g@1 ) ( int , IN int ) ) { }\n", tokenize(code3));
|
||||
}
|
||||
|
||||
void varidclass1() {
|
||||
|
|
Loading…
Reference in New Issue