From 271d836cd2ba2157b6ab51be740fef1fd7b60d62 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 29 Feb 2020 21:09:24 +0900 Subject: [PATCH] [qfcc] Catch static class instances in structs --- tools/qfcc/source/struct.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/qfcc/source/struct.c b/tools/qfcc/source/struct.c index 5fe569d31..989b298ef 100644 --- a/tools/qfcc/source/struct.c +++ b/tools/qfcc/source/struct.c @@ -47,6 +47,7 @@ #include #include +#include "class.h" #include "def.h" #include "defspace.h" #include "diagnostic.h" @@ -123,6 +124,10 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type) for (s = symtab->symbols; s; s = s->next) { if (s->sy_type != sy_var) continue; + if (obj_is_class (s->type)) { + error (0, "statically allocated instance of class %s", + s->type->t.class->name); + } if (su == 's') { symtab->size = RUP (symtab->size, s->type->alignment); s->s.offset = symtab->size;