This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18545] [3.4/4.0 regression] ICE when returning undefined type
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Nov 2004 02:42:13 -0000
- Subject: [Bug c++/18545] [3.4/4.0 regression] ICE when returning undefined type
- References: <20041118160250.18545.reichelt@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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