Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 8f650f03fa027cdd821777209b296cf34ae687da)
+++ src/Parser/DeclarationNode.cc	(revision 057608ac6cb8128dfade87d081f239b0aec340c9)
@@ -185,5 +185,4 @@
 	newnode->type->aggregate.fields = fields;
 	newnode->type->aggregate.body = body;
-	newnode->type->aggregate.tagged = false;
 	newnode->type->aggregate.parent = nullptr;
 	return newnode;
@@ -199,6 +198,10 @@
 	newnode->type->enumeration.typed = typed;
 	newnode->type->enumeration.hiding = hiding;
-	if ( base && base->type )  {
+	if ( base ) {
+		assert( typed );
+		assert( base->type );
 		newnode->type->base = base->type;
+		base->type = nullptr;
+		delete base;
 	} // if
 
@@ -220,14 +223,12 @@
 
 DeclarationNode * DeclarationNode::newEnumValueGeneric( const string * name, InitializerNode * init ) {
-	if ( init ) {
-		if ( init->get_expression() ) {
-			return newEnumConstant( name, init->get_expression() );
-		} else {
-			DeclarationNode * newnode = newName( name );
-			newnode->initializer = init;
-			return newnode;
-		} // if
+	if ( nullptr == init ) {
+		return newName( name );
+	} else if ( init->get_expression() ) {
+		return newEnumConstant( name, init->get_expression() );
 	} else {
-		return newName( name );
+		DeclarationNode * newnode = newName( name );
+		newnode->initializer = init;
+		return newnode;
 	} // if
 } // DeclarationNode::newEnumValueGeneric
@@ -549,5 +550,4 @@
 	newaggr->aggregate.body = false;
 	newaggr->aggregate.anon = oldaggr->aggregate.anon;
-	newaggr->aggregate.tagged = oldaggr->aggregate.tagged;
 	swap( newaggr, oldaggr );
 
@@ -596,4 +596,9 @@
 }
 
+// Wrap the declaration in a typedef. It actually does that by modifying the
+// existing declaration, and may split it into two declarations.
+// This only happens if the wrapped type is actually a declaration of a SUE
+// type. If it does, the DeclarationNode for the SUE declaration is the node
+// returned, make sure later transformations are applied to the right node.
 DeclarationNode * DeclarationNode::addTypedef() {
 	TypeData * newtype = new TypeData( TypeData::Symbolic );
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 8f650f03fa027cdd821777209b296cf34ae687da)
+++ src/Parser/TypeData.cc	(revision 057608ac6cb8128dfade87d081f239b0aec340c9)
@@ -88,5 +88,4 @@
 		aggregate.fields = nullptr;
 		aggregate.body = false;
-		aggregate.tagged = false;
 		aggregate.parent = nullptr;
 		aggregate.anon = false;
@@ -228,5 +227,4 @@
 		newtype->aggregate.body = aggregate.body;
 		newtype->aggregate.anon = aggregate.anon;
-		newtype->aggregate.tagged = aggregate.tagged;
 		break;
 	case AggregateInst:
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision 8f650f03fa027cdd821777209b296cf34ae687da)
+++ src/Parser/TypeData.h	(revision 057608ac6cb8128dfade87d081f239b0aec340c9)
@@ -55,5 +55,4 @@
 		bool body;
 		bool anon;
-		bool tagged;
 	};
 
