mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[qfcc] Catch static class instances in structs
This commit is contained in:
parent
e93ca9d828
commit
271d836cd2
1 changed files with 5 additions and 0 deletions
|
@ -47,6 +47,7 @@
|
||||||
#include <QF/sys.h>
|
#include <QF/sys.h>
|
||||||
#include <QF/va.h>
|
#include <QF/va.h>
|
||||||
|
|
||||||
|
#include "class.h"
|
||||||
#include "def.h"
|
#include "def.h"
|
||||||
#include "defspace.h"
|
#include "defspace.h"
|
||||||
#include "diagnostic.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) {
|
for (s = symtab->symbols; s; s = s->next) {
|
||||||
if (s->sy_type != sy_var)
|
if (s->sy_type != sy_var)
|
||||||
continue;
|
continue;
|
||||||
|
if (obj_is_class (s->type)) {
|
||||||
|
error (0, "statically allocated instance of class %s",
|
||||||
|
s->type->t.class->name);
|
||||||
|
}
|
||||||
if (su == 's') {
|
if (su == 's') {
|
||||||
symtab->size = RUP (symtab->size, s->type->alignment);
|
symtab->size = RUP (symtab->size, s->type->alignment);
|
||||||
s->s.offset = symtab->size;
|
s->s.offset = symtab->size;
|
||||||
|
|
Loading…
Reference in a new issue