Unions are always static since Issue 9244.

This commit is contained in:
David Nadlinger
2013-06-11 02:14:39 +02:00
parent 6898d0fa4a
commit 24e3abff34

View File

@@ -515,17 +515,6 @@ void StructDeclaration::semantic(Scope *sc)
protection = sc->protection;
alignment = sc->structalign;
storage_class |= sc->stc;
#if IN_LLVM
// DMD allows nested unions with functions that access the outer scope, but
// generates invalid code for them (the context pointer is stored at the
// same offset as all the union fields, just as if it was a regular member).
// LDC would assert on this instead due to a type mismatch when trying to
// store the context pointer. This change mitigates the wrong-code/crash
// bug see "[dmd-internals] Nested Unions?" for a discussion on whether
// this should be legal or not.
if (isUnionDeclaration())
storage_class |= STCstatic;
#endif
if (sc->stc & STCdeprecated)
isdeprecated = true;
assert(!isAnonymous());