Produce a warning if clearscope is used on non-inner structs. Also now checking for outer class presence correctly.

This commit is contained in:
ZZYZX 2017-03-04 21:36:27 +02:00 committed by Christoph Oelckers
parent 86a494aacd
commit 6af5c1fa2b

View file

@ -501,7 +501,8 @@ void ZCCCompiler::CreateStructTypes()
Error(s->strct, "Struct %s has incompatible flags", s->NodeName().GetChars()); Error(s->strct, "Struct %s has incompatible flags", s->NodeName().GetChars());
} }
if (outer) s->Type()->ObjectFlags = FScopeBarrier::ChangeSideInObjectFlags(s->Type()->ObjectFlags, FScopeBarrier::SideFromObjectFlags(outer->ObjectFlags)); if (outer != OutNamespace) s->Type()->ObjectFlags = FScopeBarrier::ChangeSideInObjectFlags(s->Type()->ObjectFlags, FScopeBarrier::SideFromObjectFlags(outer->ObjectFlags));
else if (s->strct->Flags & ZCC_ClearScope) Warn(s->strct, "Useless 'ClearScope' on struct %s not inside a class", s->NodeName().GetChars());
if (s->strct->Flags & ZCC_UIFlag) if (s->strct->Flags & ZCC_UIFlag)
s->Type()->ObjectFlags = FScopeBarrier::ChangeSideInObjectFlags(s->Type()->ObjectFlags, FScopeBarrier::Side_UI); s->Type()->ObjectFlags = FScopeBarrier::ChangeSideInObjectFlags(s->Type()->ObjectFlags, FScopeBarrier::Side_UI);
if (s->strct->Flags & ZCC_Play) if (s->strct->Flags & ZCC_Play)