------- Additional Comments From reichelt at gcc dot gnu dot org  2004-11-25 
02:42 -------
Mark, it looks like the following patch fixes the problem.

Index: typeck.c
===================================================================
RCS file: /home/reichelt/GCC/CVS/gcc-cvs/gcc/gcc/cp/typeck.c,v
retrieving revision 1.597
diff -u -p -r1.597 typeck.c
--- typeck.c    22 Nov 2004 12:15:36 -0000      1.597
+++ typeck.c    25 Nov 2004 01:41:11 -0000
@@ -6287,6 +6287,7 @@ check_return_expr (tree retval)
   if (fn_returns_value_p && flag_elide_constructors)
     {
       if (retval != NULL_TREE
+         && TREE_TYPE (retval) != error_mark_node
          && (current_function_return_value == NULL_TREE
              || current_function_return_value == retval)
          && TREE_CODE (retval) == VAR_DECL


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18545

Reply via email to