aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--decl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/decl.c b/decl.c
index ea62f56..d9e2a85 100644
--- a/decl.c
+++ b/decl.c
@@ -206,6 +206,8 @@ tagspec(struct scope *s)
b.bits = 0;
do structdecl(s, &b);
while (tok.kind != TRBRACE);
+ if (!t->structunion.members)
+ error(&tok.loc, "struct/union has no members");
next();
t->size = ALIGNUP(t->size, t->align);
t->incomplete = false;