Skip to content

Commit 8be1784

Browse files
committed
fix #14106
1 parent 97ec6c6 commit 8be1784

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/tokenize.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9205,7 +9205,8 @@ void Tokenizer::simplifyStructDecl()
92059205
}
92069206

92079207
// check for initialization
9208-
if (Token::Match(after, "%any% (|{")) {
9208+
bool isFuncDecl = Token::Match(after, "%name% (") && Token::simpleMatch(after->linkAt(1), ") {");
9209+
if (Token::Match(after, "%any% (|{") && !isFuncDecl) {
92099210
after->insertToken("=");
92109211
after = after->next();
92119212
const bool isEnum = start->str() == "enum";

0 commit comments

Comments
 (0)