aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tccgen.c5
-rw-r--r--tests/tcctest.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index 4d35bed..930993a 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -3250,7 +3250,10 @@ static void struct_decl(CType *type, AttributeDef *ad, int u)
offset = 0;
flexible = 0;
while (tok != '}') {
- parse_btype(&btype, &ad1);
+ if (!parse_btype(&btype, &ad1)) {
+ skip(';');
+ continue;
+ }
while (1) {
extra_bytes = 0;
if (flexible)
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 7fd8171..41a9a10 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -642,6 +642,11 @@ union union2 {
struct struct1 st1, st2;
+struct empty_mem {
+ /* nothing */ ;
+ int x;
+};
+
int main(int argc, char **argv)
{
string_test();