Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 51f3798005b3649fb4f041cf88dd42cc981f7f73)
+++ src/Parser/DeclarationNode.cc	(revision 6ce9f7c70cd2db82c1c7567345c25729c6cf6719)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 12:34:05 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 13:06:50 2017
-// Update Count     : 753
+// Last Modified On : Thu Feb 23 15:45:02 2017
+// Update Count     : 759
 //
 
@@ -174,8 +174,4 @@
 	} // if
 
-	if ( body ) {
-		newnode->type->function.hasBody = true;
-	} // if
-
 	if ( ret ) {
 		newnode->type->base = ret->type;
@@ -259,5 +255,5 @@
 } // DeclarationNode::newAggregate
 
-DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants ) {
+DeclarationNode * DeclarationNode::newEnum( string * name, DeclarationNode * constants, bool body ) {
 	DeclarationNode * newnode = new DeclarationNode;
 	newnode->type = new TypeData( TypeData::Enum );
@@ -268,4 +264,5 @@
 	} // if
 	newnode->type->enumeration.constants = constants;
+	newnode->type->enumeration.body = body;
 	return newnode;
 } // DeclarationNode::newEnum
@@ -698,5 +695,4 @@
 	assert( ! type->function.body );
 	type->function.body = body;
-	type->function.hasBody = true;
 	return this;
 }
@@ -1040,24 +1036,45 @@
 	switch ( type->kind ) {
 	  case TypeData::Enum: {
-		  EnumDecl * typedecl = buildEnum( type, attributes );
-		  return new EnumInstType( buildQualifiers( type ), typedecl );
+		  if ( type->enumeration.body ) {
+			  EnumDecl * typedecl = buildEnum( type, attributes );
+			  return new EnumInstType( buildQualifiers( type ), typedecl );
+		  } else {
+			  return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
+		  }
 	  }
 	  case TypeData::Aggregate: {
-		  AggregateDecl * typedecl = buildAggregate( type, attributes );
 		  ReferenceToType * ret;
-		  switch ( type->aggregate.kind ) {
-			case DeclarationNode::Struct:
-			  ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
-			  break;
-			case DeclarationNode::Union:
-			  ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
-			  break;
-			case DeclarationNode::Trait:
-			  assert( false );
-			  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
-			  break;
-			default:
-			  assert( false );
-		  } // switch
+		  if ( type->aggregate.body ) {
+			  AggregateDecl * typedecl = buildAggregate( type, attributes );
+			  switch ( type->aggregate.kind ) {
+				case DeclarationNode::Struct:
+				  ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
+				  break;
+				case DeclarationNode::Union:
+				  ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
+				  break;
+				case DeclarationNode::Trait:
+				  assert( false );
+				  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
+				  break;
+				default:
+				  assert( false );
+			  } // switch
+		  } else {
+			  switch ( type->aggregate.kind ) {
+				case DeclarationNode::Struct:
+				  ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
+				  break;
+				case DeclarationNode::Union:
+				  ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
+				  break;
+				case DeclarationNode::Trait:
+				  assert( false );
+				  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
+				  break;
+				default:
+				  assert( false );
+			  } // switch
+		  } // if
 		  buildList( type->aggregate.actuals, ret->get_parameters() );
 		  return ret;
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 51f3798005b3649fb4f041cf88dd42cc981f7f73)
+++ src/Parser/ParseNode.h	(revision 6ce9f7c70cd2db82c1c7567345c25729c6cf6719)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 13:15:55 2017
-// Update Count     : 661
+// Last Modified On : Thu Feb 23 15:22:10 2017
+// Update Count     : 662
 //
 
@@ -238,5 +238,5 @@
 	static DeclarationNode * newFromTypedef( std::string * );
 	static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
-	static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants );
+	static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );
 	static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );
 	static DeclarationNode * newName( std::string * );
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 51f3798005b3649fb4f041cf88dd42cc981f7f73)
+++ src/Parser/TypeData.cc	(revision 6ce9f7c70cd2db82c1c7567345c25729c6cf6719)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:12:51 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Sun Feb 19 09:49:33 2017
-// Update Count     : 467
+// Last Modified On : Thu Feb 23 16:26:39 2017
+// Update Count     : 477
 //
 
@@ -48,5 +48,4 @@
 		function.oldDeclList = nullptr;
 		function.body = nullptr;
-		function.hasBody = false;
 		function.newStyle = false;
 		break;
@@ -68,4 +67,5 @@
 		enumeration.name = nullptr;
 		enumeration.constants = nullptr;
+		enumeration.body = false;
 		break;
 	  case Symbolic:
@@ -182,5 +182,4 @@
 		newtype->function.oldDeclList = maybeClone( function.oldDeclList );
 		newtype->function.body = maybeClone( function.body );
-		newtype->function.hasBody = function.hasBody;
 		newtype->function.newStyle = function.newStyle;
 		break;
@@ -200,4 +199,5 @@
 		newtype->enumeration.name = enumeration.name ? new string( *enumeration.name ) : nullptr;
 		newtype->enumeration.constants = maybeClone( enumeration.constants );
+		newtype->enumeration.body = enumeration.body;
 		break;
 	  case Symbolic:
@@ -293,8 +293,6 @@
 		} // if
 		os << endl;
-		if ( function.hasBody ) {
+		if ( function.body ) {
 			os << string( indent + 2, ' ' ) << "with body " << endl;
-		} // if
-		if ( function.body ) {
 			function.body->printList( os, indent + 2 );
 		} // if
@@ -335,4 +333,7 @@
 			os << "with constants" << endl;
 			enumeration.constants->printList( os, indent + 2 );
+		} // if
+		if ( enumeration.body ) {
+			os << string( indent + 2, ' ' ) << " with body " << endl;
 		} // if
 		break;
@@ -696,4 +697,5 @@
 		} // if
 	} // for
+	ret->set_body( td->enumeration.body );
 	return ret;
 } // buildEnum
@@ -724,22 +726,12 @@
 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, ConstantExpr *asmName, Initializer * init, std::list< Attribute * > attributes ) {
 	if ( td->kind == TypeData::Function ) {
-		if ( td->function.idList ) {
-			buildKRFunction( td->function );
+		if ( td->function.idList ) {					// KR function ?
+			buildKRFunction( td->function );			// transform into C11 function
 		} // if
 
 		FunctionDecl * decl;
-		if ( td->function.hasBody ) {
-			if ( td->function.body ) {
-				Statement * stmt = td->function.body->build();
-				CompoundStmt * body = dynamic_cast< CompoundStmt* >( stmt );
-				assert( body );
-				decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn, attributes );
-			} else {
-				// list< Label > ls;
-				decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), new CompoundStmt( list< Label >() ), isInline, isNoreturn, attributes );
-			} // if
-		} else {
-			decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), nullptr, isInline, isNoreturn, attributes );
-		} // if
+		Statement * stmt = maybeBuild<Statement>( td->function.body );
+		CompoundStmt * body = dynamic_cast< CompoundStmt* >( stmt );
+		decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), body, isInline, isNoreturn, attributes );
 		return decl->set_asmName( asmName );
 	} else if ( td->kind == TypeData::Aggregate ) {
@@ -816,5 +808,5 @@
 
 	for ( DeclarationNode * param = function.idList; param != nullptr; param = dynamic_cast< DeclarationNode* >( param->get_next() ) ) {
-		if ( ! param->type ) {							// generate type int for empty parameters
+		if ( ! param->type ) {							// generate type int for empty parameter type
 			param->type = new TypeData( TypeData::Basic );
 			param->type->basictype = DeclarationNode::Int;
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision 51f3798005b3649fb4f041cf88dd42cc981f7f73)
+++ src/Parser/TypeData.h	(revision 6ce9f7c70cd2db82c1c7567345c25729c6cf6719)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:18:36 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 14:30:05 2017
-// Update Count     : 153
+// Last Modified On : Thu Feb 23 15:16:18 2017
+// Update Count     : 155
 //
 
@@ -49,4 +49,5 @@
 		const std::string * name;
 		DeclarationNode * constants;
+		bool body;
 	};
 
@@ -56,5 +57,4 @@
 		mutable DeclarationNode * oldDeclList;
 		StatementNode * body;
-		bool hasBody;
 		bool newStyle;
 	};
Index: src/Parser/parser.cc
===================================================================
--- src/Parser/parser.cc	(revision 51f3798005b3649fb4f041cf88dd42cc981f7f73)
+++ src/Parser/parser.cc	(revision 6ce9f7c70cd2db82c1c7567345c25729c6cf6719)
@@ -7292,5 +7292,5 @@
 /* Line 1806 of yacc.c  */
 #line 1651 "parser.yy"
-    { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(4) - (6)].decl) )->addQualifiers( (yyvsp[(2) - (6)].decl) ); }
+    { (yyval.decl) = DeclarationNode::newEnum( nullptr, (yyvsp[(4) - (6)].decl), true )->addQualifiers( (yyvsp[(2) - (6)].decl) ); }
     break;
 
@@ -7301,5 +7301,5 @@
     {
 			typedefTable.makeTypedef( *(yyvsp[(3) - (3)].tok) );
-			(yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (3)].tok), 0 )->addQualifiers( (yyvsp[(2) - (3)].decl) );
+			(yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (3)].tok), 0, false )->addQualifiers( (yyvsp[(2) - (3)].decl) );
 		}
     break;
@@ -7316,5 +7316,5 @@
 /* Line 1806 of yacc.c  */
 #line 1660 "parser.yy"
-    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (8)].tok), (yyvsp[(6) - (8)].decl) )->addQualifiers( (yyvsp[(2) - (8)].decl) ); }
+    { (yyval.decl) = DeclarationNode::newEnum( (yyvsp[(3) - (8)].tok), (yyvsp[(6) - (8)].decl), true )->addQualifiers( (yyvsp[(2) - (8)].decl) ); }
     break;
 
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision 51f3798005b3649fb4f041cf88dd42cc981f7f73)
+++ src/Parser/parser.yy	(revision 6ce9f7c70cd2db82c1c7567345c25729c6cf6719)
@@ -10,6 +10,6 @@
 // Created On       : Sat Sep  1 20:22:55 2001
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb 16 15:56:33 2017
-// Update Count     : 2186
+// Last Modified On : Thu Feb 23 15:23:49 2017
+// Update Count     : 2187
 //
 
@@ -1649,14 +1649,14 @@
 enum_type:
 	ENUM attribute_list_opt '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( nullptr, $4 )->addQualifiers( $2 ); }
+		{ $$ = DeclarationNode::newEnum( nullptr, $4, true )->addQualifiers( $2 ); }
 	| ENUM attribute_list_opt no_attr_identifier_or_type_name
 		{
 			typedefTable.makeTypedef( *$3 );
-			$$ = DeclarationNode::newEnum( $3, 0 )->addQualifiers( $2 );
+			$$ = DeclarationNode::newEnum( $3, 0, false )->addQualifiers( $2 );
 		}
 	| ENUM attribute_list_opt no_attr_identifier_or_type_name
 		{ typedefTable.makeTypedef( *$3 ); }
 	  '{' enumerator_list comma_opt '}'
-		{ $$ = DeclarationNode::newEnum( $3, $6 )->addQualifiers( $2 ); }
+		{ $$ = DeclarationNode::newEnum( $3, $6, true )->addQualifiers( $2 ); }
 	;
 
