Skipped anonymous tag names in diagnosis on empty structs/unions.

This commit is contained in:
acqn 2024-01-15 23:56:39 +08:00
parent afdf398a0b
commit 07e349c517
1 changed files with 7 additions and 1 deletions

View File

@ -955,7 +955,13 @@ SymEntry* AddStructSym (const char* Name, unsigned Flags, unsigned Size, SymTabl
TagEntry = 0;
} else if (Size == 0) {
/* Empty struct is not supported now */
Error ("Empty %s type '%s' is not supported", SCType == SC_STRUCT ? "struct" : "union", Name);
if (!IsAnonName (Name)) {
Error ("Empty %s type '%s' is not supported",
SCType == SC_STRUCT ? "struct" : "union", Name);
} else {
Error ("Empty %s type is not supported",
SCType == SC_STRUCT ? "struct" : "union");
}
TagEntry = 0;
}
}