Index: src/AST/SymbolTable.cpp
===================================================================
--- src/AST/SymbolTable.cpp	(revision fb4dc2836f4baf232dfe867576343c1133659525)
+++ src/AST/SymbolTable.cpp	(revision d859a304c3462b4df9c1da7c43844f9ba9c1a3f2)
@@ -260,10 +260,10 @@
 void SymbolTable::addId( const DeclWithType * decl, const Expr * baseExpr ) {
 	// default handling of conflicts is to raise an error
-	addId( decl, OnConflict::error(), baseExpr, decl->isDeleted ? decl : nullptr );
+	addIdCommon( decl, OnConflict::error(), baseExpr, decl->isDeleted ? decl : nullptr );
 }
 
 void SymbolTable::addDeletedId( const DeclWithType * decl, const Decl * deleter ) {
 	// default handling of conflicts is to raise an error
-	addId( decl, OnConflict::error(), nullptr, deleter );
+	addIdCommon( decl, OnConflict::error(), nullptr, deleter );
 }
 
@@ -677,10 +677,10 @@
 }
 
-void SymbolTable::addId(
-		const DeclWithType * decl, SymbolTable::OnConflict handleConflicts, const Expr * baseExpr,
-		const Decl * deleter ) {
+void SymbolTable::addIdCommon(
+		const DeclWithType * decl, SymbolTable::OnConflict handleConflicts,
+		const Expr * baseExpr, const Decl * deleter ) {
 	SpecialFunctionKind kind = getSpecialFunctionKind(decl->name);
 	if (kind == NUMBER_OF_KINDS) { // not a special decl
-		addId(decl, decl->name, idTable, handleConflicts, baseExpr, deleter);
+		addIdToTable(decl, decl->name, idTable, handleConflicts, baseExpr, deleter);
 	}
 	else {
@@ -695,11 +695,12 @@
 			assertf(false, "special decl with non-function type");
 		}
-		addId(decl, key, specialFunctionTable[kind], handleConflicts, baseExpr, deleter);
-	}
-}
-
-void SymbolTable::addId(
-		const DeclWithType * decl, const std::string & lookupKey, IdTable::Ptr & table, SymbolTable::OnConflict handleConflicts, const Expr * baseExpr,
-		const Decl * deleter ) {
+		addIdToTable(decl, key, specialFunctionTable[kind], handleConflicts, baseExpr, deleter);
+	}
+}
+
+void SymbolTable::addIdToTable(
+		const DeclWithType * decl, const std::string & lookupKey,
+		IdTable::Ptr & table, SymbolTable::OnConflict handleConflicts,
+		const Expr * baseExpr, const Decl * deleter ) {
 	++*stats().add_calls;
 	const std::string &name = decl->name;
@@ -778,22 +779,22 @@
 void SymbolTable::addMembers(
 		const AggregateDecl * aggr, const Expr * expr, SymbolTable::OnConflict handleConflicts ) {
-	for ( const Decl * decl : aggr->members ) {
-		if ( auto dwt = dynamic_cast< const DeclWithType * >( decl ) ) {
-			addId( dwt, handleConflicts, expr );
-			if ( dwt->name == "" ) {
-				const Type * t = dwt->get_type()->stripReferences();
-				if ( auto rty = dynamic_cast<const BaseInstType *>( t ) ) {
-					if ( ! dynamic_cast<const StructInstType *>(rty)
-						&& ! dynamic_cast<const UnionInstType *>(rty) ) continue;
-					ResolvExpr::Cost cost = ResolvExpr::Cost::zero;
-					ast::ptr<ast::TypeSubstitution> tmp = expr->env;
-					expr = mutate_field(expr, &Expr::env, nullptr);
-					const Expr * base = ResolvExpr::referenceToRvalueConversion( expr, cost );
-					base = mutate_field(base, &Expr::env, tmp);
-
-					addMembers(
-						rty->aggr(), new MemberExpr{ base->location, dwt, base }, handleConflicts );
-				}
-			}
+	for ( const ptr<Decl> & decl : aggr->members ) {
+		auto dwt = decl.as<DeclWithType>();
+		if ( nullptr == dwt ) continue;
+		addIdCommon( dwt, handleConflicts, expr );
+		// Inline through unnamed struct/union members.
+		if ( "" != dwt->name ) continue;
+		const Type * t = dwt->get_type()->stripReferences();
+		if ( auto rty = dynamic_cast<const BaseInstType *>( t ) ) {
+			if ( ! dynamic_cast<const StructInstType *>(rty)
+				&& ! dynamic_cast<const UnionInstType *>(rty) ) continue;
+			ResolvExpr::Cost cost = ResolvExpr::Cost::zero;
+			ast::ptr<ast::TypeSubstitution> tmp = expr->env;
+			expr = mutate_field(expr, &Expr::env, nullptr);
+			const Expr * base = ResolvExpr::referenceToRvalueConversion( expr, cost );
+			base = mutate_field(base, &Expr::env, tmp);
+
+			addMembers(
+				rty->aggr(), new MemberExpr{ base->location, dwt, base }, handleConflicts );
 		}
 	}
Index: src/AST/SymbolTable.hpp
===================================================================
--- src/AST/SymbolTable.hpp	(revision fb4dc2836f4baf232dfe867576343c1133659525)
+++ src/AST/SymbolTable.hpp	(revision d859a304c3462b4df9c1da7c43844f9ba9c1a3f2)
@@ -192,13 +192,14 @@
 
 	/// common code for addId, addDeletedId, etc.
-	void addId(
-		const DeclWithType * decl, OnConflict handleConflicts, const Expr * baseExpr = nullptr,
-		const Decl * deleter = nullptr );
+	void addIdCommon(
+		const DeclWithType * decl, OnConflict handleConflicts,
+		const Expr * baseExpr = nullptr, const Decl * deleter = nullptr );
 
 	/// common code for addId when special decls are placed into separate tables
-	void addId(
-		const DeclWithType * decl, const std::string & lookupKey, IdTable::Ptr & idTable, OnConflict handleConflicts, 
+	void addIdToTable(
+		const DeclWithType * decl, const std::string & lookupKey,
+		IdTable::Ptr & idTable, OnConflict handleConflicts,
 		const Expr * baseExpr = nullptr, const Decl * deleter = nullptr);
-	
+
 	/// adds all of the members of the Aggregate (addWith helper)
 	void addMembers( const AggregateDecl * aggr, const Expr * expr, OnConflict handleConflicts );
