Fix #18235 - Add offending member to "no size because of forward reference" error (#20557)

Co-authored-by: Nick Treleaven <ntrel002@gmail.com>
This commit is contained in:
Nicholas Wilson 2024-12-15 18:23:36 +08:00 committed by GitHub
parent 1fd2fdb84b
commit 13775eb2d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 12 deletions

View file

@ -171,11 +171,12 @@ extern (C++) class StructDeclaration : AggregateDeclaration
{
Dsymbol s = (*members)[i];
s.setFieldOffset(this, &fieldState, isunion);
}
if (type.ty == Terror)
{
errors = true;
return;
if (type.ty == Terror)
{
errorSupplemental(s.loc, "error on member `%s`", s.toPrettyChars);
errors = true;
return;
}
}
if (structsize == 0)