Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 8a4da06cd7d699462d18bdd4c5af2d1418a98345)
+++ src/CodeGen/CodeGenerator.cc	(revision 76b48f10023ecff298f81e17b71dea4d7de979cf)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri Sep 11 12:59:09 2015
-// Update Count     : 223
+// Last Modified On : Tue Sep 15 13:55:27 2015
+// Update Count     : 230
 //
 
@@ -322,4 +322,6 @@
 	      
 				  case OT_CALL:
+				  case OT_CTOR:
+				  case OT_DTOR:
 					assert( false );
 					break;
@@ -392,13 +394,20 @@
 
 	void CodeGenerator::visit( CastExpr *castExpr ) {
-		output << "((";
-		if ( castExpr->get_results().empty() ) {
-			output << "void" ;
-		} else {
-			output << genType( castExpr->get_results().front(), "" );
-		} // if
-		output << ")";
-		castExpr->get_arg()->accept( *this );
-		output << ")";
+		// if the cast is to an lvalue type, then the cast
+		// should be dropped, since the result of a cast is
+		// never an lvalue in C
+		if ( castExpr->get_results().front()->get_isLvalue() ) {
+			castExpr->get_arg()->accept( *this );
+		} else {
+			output << "((";
+			if ( castExpr->get_results().empty() ) {
+				output << "void" ;
+			} else {
+				output << genType( castExpr->get_results().front(), "" );
+			} // if
+			output << ")";
+			castExpr->get_arg()->accept( *this );
+			output << ")";			
+		}
 	}
   
