Index: src/Virtual/ExpandCasts.cc
===================================================================
--- src/Virtual/ExpandCasts.cc	(revision 37273c8cb34ce14d7da1cb9d4d43491327ff6807)
+++ src/Virtual/ExpandCasts.cc	(revision 4c2fe47e178e4074ffe9d1387cbe05d69e4c0db3)
@@ -9,7 +9,7 @@
 // Author           : Andrew Beach
 // Created On       : Mon Jul 24 13:59:00 2017
-// Last Modified By : Andrew Beach
-// Last Modified On : Thu Aug 11 12:06:00 2022
-// Update Count     : 5
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Mon Nov 27 09:28:20 2023
+// Update Count     : 10
 //
 
@@ -160,9 +160,7 @@
 
 	// Helper function for throwing semantic errors.
-	auto throwError = [&fieldName, &errorLocation, &oldDecl](
-			std::string const & message ) {
-		std::string const & context = "While following head pointer of " +
-			oldDecl->name + " named '" + fieldName + "': ";
-		SemanticError( errorLocation, context + message );
+	auto throwError = [&fieldName, &errorLocation, &oldDecl]( std::string const & message ) {
+		SemanticError( errorLocation, "While following head pointer of %s named \"%s\": %s",
+					   oldDecl->name.c_str(), fieldName.c_str(), message.c_str() );
 	};
 
