Fixed ticket #3703 (false positive: syntax error on valid C-code ( K&R - style )).
This commit is contained in:
parent
5d91ef76fe
commit
ecc5dea113
|
@ -5375,8 +5375,7 @@ void Tokenizer::simplifyVarDecl(bool only_k_r_fpar)
|
|||
tok2 = tok2->next();
|
||||
}
|
||||
}
|
||||
if (only_k_r_fpar && !finishedwithkr && tok2->strAt(1) == "{")
|
||||
finishedwithkr = true;
|
||||
finishedwithkr = (only_k_r_fpar && tok2->strAt(1) == "{");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4764,6 +4764,20 @@ private:
|
|||
"{\n"
|
||||
"}", tokenizeAndStringify(code));
|
||||
}
|
||||
{
|
||||
const char code[] = "void f(r,s,t)\n"
|
||||
"char *r,*s,*t;\n"
|
||||
"{\n"
|
||||
"}\n";
|
||||
|
||||
ASSERT_EQUALS("void f (\n"
|
||||
"char * r,\n"
|
||||
"char * s,\n"
|
||||
"char * t)\n"
|
||||
"\n"
|
||||
"{\n"
|
||||
"}", tokenizeAndStringify(code));
|
||||
}
|
||||
}
|
||||
|
||||
void volatile_variables() {
|
||||
|
|
Loading…
Reference in New Issue