Index: src/ControlStruct/HoistControlDecls.cpp
===================================================================
--- src/ControlStruct/HoistControlDecls.cpp	(revision c248b39bb4692247b9aeda9dc3201a9132c577c5)
+++ src/ControlStruct/HoistControlDecls.cpp	(revision 433e2c3fb7ad367e63441101bb26ac863372e64e)
@@ -9,7 +9,7 @@
 // Author           : Andrew Beach
 // Created On       : Fri Dec  3 15:34:00 2021
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Feb  1 18:59:47 2022
-// Update Count     : 25
+// Last Modified By : Andrew Beach
+// Last Modified On : Wed Jul 24 12:00:00 2024
+// Update Count     : 3
 //
 
@@ -23,34 +23,39 @@
 namespace ControlStruct {
 
+namespace {
+
 template<typename StmtT>
 const Stmt * hoist( const StmtT * stmt ) {
-	// If no hoisting is needed, then make no changes.
-
-	if ( stmt->inits.size() == 0 ) {					// no declarations ?
+	// If no hoisting is needed (no declaration), then make no changes.
+	if ( stmt->inits.size() == 0 ) {
 		// if ( /* no conditional declarations */ ...  ) ...
 		return stmt;
-	} // if
+	}
 
-	// Put hoist declarations and modified statement in a compound statement.
-
-	CompoundStmt * block = new CompoundStmt( stmt->location ); // create empty compound statement
+	StmtT * mutStmt = mutate( stmt );
+	CompoundStmt * block = new CompoundStmt( stmt->location );
 	//    {}
 
-	for ( const Stmt * next : stmt->inits ) {			// link conditional declarations into compound
+	//    Label: if ( int x = f(), y = g(); ... ) ...
+	// link declarations into compound statement
+	for ( const Stmt * next : mutStmt->inits ) {
 		block->kids.push_back( next );
 	}
-	//    if ( int x = f(), y = g(); ... ) ...
-	// link declarations into compound statement
 	//    {
 	//         int x = f();
 	//         int y = g();
 	//    }
+	mutStmt->inits.clear();
+	//    Label: if ( ... ) ...
 
-	StmtT * mutStmt = mutate( stmt );					// create mutate handle to change statement
-	mutStmt->inits.clear();								// remove declarations
+	block->labels.swap( mutStmt->labels );
+	//    Label: {
+	//        int x = f();
+	//        int y = g();
+	//    }
 	//    if ( ... ) ...
 
-	block->kids.push_back( mutStmt );					// link modified statement into compound
-	//    {
+	block->kids.push_back( mutStmt );
+	//    Label: {
 	//        int x = f();
 	//        int y = g();
@@ -73,4 +78,6 @@
 };
 
+} // namespace
+
 // Hoist initialization out of for statements.
 void hoistControlDecls( TranslationUnit & translationUnit ) {
Index: src/ControlStruct/HoistControlDecls.hpp
===================================================================
--- src/ControlStruct/HoistControlDecls.hpp	(revision c248b39bb4692247b9aeda9dc3201a9132c577c5)
+++ src/ControlStruct/HoistControlDecls.hpp	(revision 433e2c3fb7ad367e63441101bb26ac863372e64e)
@@ -9,6 +9,6 @@
 // Author           : Andrew Beach
 // Created On       : Fri Dec  3 15:31:00 2021
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Jan 31 22:25:07 2022
+// Last Modified By : Andrew Beach
+// Last Modified On : Wed Jul 24 12:04:00 2024
 // Update Count     : 3
 //
@@ -21,7 +21,10 @@
 
 namespace ControlStruct {
+
 /// Hoist declarations out of control flow statements into compound statement.
-/// Must happen before auto-gen routines are added.
+/// Must happen before auto-gen routines are added and after loop control
+/// flow is resolved.
 void hoistControlDecls( ast::TranslationUnit & translationUnit );
+
 } // namespace ControlStruct
 
