Fixed #3927 (false positive: (error) Uninitialized variable: new)
This commit is contained in:
parent
f5f63dc4a6
commit
bf98e952c1
|
@ -4874,7 +4874,7 @@ void Tokenizer::simplifyVarDecl(bool only_k_r_fpar)
|
|||
if (Token::Match(tok2, "%type% *| %var% , %type% *| %var%"))
|
||||
continue;
|
||||
|
||||
if (Token::Match(tok2, "struct|class %type%")) {
|
||||
if (Token::Match(tok2, "struct|union|class %type%")) {
|
||||
tok2 = tok2->next();
|
||||
++typelen;
|
||||
}
|
||||
|
|
|
@ -4726,6 +4726,10 @@ private:
|
|||
" };\n"
|
||||
"}";
|
||||
ASSERT_EQUALS("void f ( ) {\n\nint x ;\nlong & y = x ;\n\n}", tokenizeAndStringify(code2));
|
||||
|
||||
// ticket #3927
|
||||
const char code3[] = "union xy *p = NULL;";
|
||||
ASSERT_EQUALS("union xy * p ; p = 0 ;", tokenizeAndStringify(code3));
|
||||
}
|
||||
|
||||
void vardecl_par() {
|
||||
|
|
Loading…
Reference in New Issue