Skip to content

Commit 4533410

Browse files
ibuclawdlang-bot
authored andcommitted
fix Issue 22274 - importC: [ICE]: 4 identifiers does not match 3 declarations using K&R syntax
1 parent 4f1e48a commit 4533410

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/dmd/cparse.d

+5
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,8 @@ final class CParser(AST) : Parser!AST
16861686
return;
16871687

16881688
case TOK.comma:
1689+
if (!symbolsSave)
1690+
symbolsSave = symbols;
16891691
nextToken();
16901692
break;
16911693

@@ -1768,7 +1770,10 @@ final class CParser(AST) : Parser!AST
17681770
}
17691771
}
17701772
if (!p.type)
1773+
{
17711774
error("no declaration for identifier `%s`", p.ident.toChars());
1775+
p.type = AST.Type.terror;
1776+
}
17721777
}
17731778
}
17741779

test/compilable/testcstuff2.c

+9
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,12 @@ void test22262(unsigned char *buf)
411411
}
412412

413413
/***************************************************/
414+
// https://issues.dlang.org/show_bug.cgi?id=22274
415+
416+
void test22274(compr, comprLen, uncompr, uncomprLen)
417+
unsigned *compr, *uncompr;
418+
signed comprLen, uncomprLen;
419+
{
420+
}
421+
422+
/***************************************************/

0 commit comments

Comments
 (0)