Skip to content

Commit

Permalink
fix Issue 22274 - importC: [ICE]: 4 identifiers does not match 3 decl…
Browse files Browse the repository at this point in the history
…arations using K&R syntax
  • Loading branch information
ibuclaw authored and dlang-bot committed Sep 6, 2021
1 parent 4f1e48a commit 4533410
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dmd/cparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,8 @@ final class CParser(AST) : Parser!AST
return;

case TOK.comma:
if (!symbolsSave)
symbolsSave = symbols;
nextToken();
break;

Expand Down Expand Up @@ -1768,7 +1770,10 @@ final class CParser(AST) : Parser!AST
}
}
if (!p.type)
{
error("no declaration for identifier `%s`", p.ident.toChars());
p.type = AST.Type.terror;
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions test/compilable/testcstuff2.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,12 @@ void test22262(unsigned char *buf)
}

/***************************************************/
// https://issues.dlang.org/show_bug.cgi?id=22274

void test22274(compr, comprLen, uncompr, uncomprLen)
unsigned *compr, *uncompr;
signed comprLen, uncomprLen;
{
}

/***************************************************/

0 comments on commit 4533410

Please sign in to comment.