Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 43f29f61a981799b22157737f6efcce521dda879)
+++ src/Parser/DeclarationNode.cc	(revision 78e2fcaec16b900f216a6cdecc172ee241c1f7ad)
@@ -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 14:12:03 2023
-// Update Count     : 1388
+// Last Modified On : Fri Feb 24 11:10:03 2023
+// Update Count     : 1400
 //
 
@@ -254,5 +254,5 @@
 	newnode->type->enumeration.typed = typed;
 	newnode->type->enumeration.hiding = hiding;
-	if ( base && base->type)  {
+	if ( base && base->type )  {
 		newnode->type->base = base->type;
 	} // if
@@ -567,5 +567,5 @@
 
 	checkQualifiers( type, q->type );
-	if ( (builtin == Zero || builtin == One) && q->type->qualifiers.val != 0 && error.length() == 0 ) {
+	if ( (builtin == Zero || builtin == One) && q->type->qualifiers.any() && error.length() == 0 ) {
 		SemanticWarning( yylloc, Warning::BadQualifiersZeroOne, Type::QualifiersNames[ilog2( q->type->qualifiers.val )], builtinTypeNames[builtin] );
 	} // if
@@ -984,5 +984,37 @@
 
 			if ( DeclarationNode * extr = cur->extractAggregate() ) {
-				// handle the case where a structure declaration is contained within an object or type declaration
+				// Handle the case where a SUE declaration is contained within an object or type declaration.
+
+				assert( cur->type );
+				// Replace anonymous SUE name with typedef name to prevent anonymous naming problems across translation units.
+				if ( cur->type->kind == TypeData::Symbolic && cur->type->symbolic.isTypedef ) {
+					assert( extr->type );
+					// Handle anonymous aggregates: typedef struct { int i; } foo
+					extr->type->qualifiers.reset();		// clear any CVs associated with the aggregate
+					if ( extr->type->kind == TypeData::Aggregate && extr->type->aggregate.anon ) {
+						delete extr->type->aggregate.name;
+						extr->type->aggregate.name = new string( "__anonymous_" + *cur->name );
+						extr->type->aggregate.anon = false;
+						assert( cur->type->base );
+						if ( cur->type->base ) {
+							delete cur->type->base->aggInst.aggregate->aggregate.name;
+							cur->type->base->aggInst.aggregate->aggregate.name = new string( "__anonymous_" + *cur->name );
+							cur->type->base->aggInst.aggregate->aggregate.anon = false;
+							cur->type->base->aggInst.aggregate->qualifiers.reset();
+						} // if
+					} // if
+					// Handle anonymous enumeration: typedef enum { A, B, C } foo
+					if ( extr->type->kind == TypeData::Enum && extr->type->enumeration.anon ) {
+						delete extr->type->enumeration.name;
+						extr->type->enumeration.name = new string( "__anonymous_" + *cur->name );
+						extr->type->enumeration.anon = false;
+						assert( cur->type->base );
+						if ( cur->type->base ) {
+							delete cur->type->base->aggInst.aggregate->enumeration.name;
+							cur->type->base->aggInst.aggregate->enumeration.name = new string( "__anonymous_" + *cur->name );
+							cur->type->base->aggInst.aggregate->enumeration.anon = false;
+						} // if
+					} // if
+				} // if
 
 				Declaration * decl = extr->build();
