diff --git a/tccgen.c b/tccgen.c
index 0f0aac5..af8140a 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -2824,6 +2824,9 @@ static void struct_decl(CType *type, int u, int tdef)
                         type_decl(&type1, &ad, &v, TYPE_DIRECT | TYPE_ABSTRACT);
                         if (v == 0 && (type1.t & VT_BTYPE) != VT_STRUCT)
                             expect("identifier");
+                       if (type_size(&type1, &align) < 0)
+                            tcc_error("field '%s' has incomplete type", 
+                                  get_tok_str(v, NULL));
                         if ((type1.t & VT_BTYPE) == VT_FUNC ||
                             (type1.t & (VT_TYPEDEF | VT_STATIC | VT_EXTERN | VT_INLINE)))
                             tcc_error("invalid type for '%s'", 
