Internal compiler error 754867
Martin von Loewis
martin@mira.isdn.cs.tu-berlin.de
Fri Oct 23 09:03:00 GMT 1998
> The sample below is incorrect, but the compiler
> should not break down.
Thanks for your report. A patch is included below, a similar test case
has been installed as g++.martin/conv1.C.
Regards,
Martin
1998-10-23 Martin von Löwis <loewis@informatik.hu-berlin.de>
* semantics.c (finish_if_stmt_cond): Convert references to
indirect references.
Index: semantics.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/semantics.c,v
retrieving revision 1.33
diff -c -p -r1.33 semantics.c
*** semantics.c 1998/10/08 16:04:13 1.33
--- semantics.c 1998/10/23 15:54:17
*************** finish_if_stmt_cond (cond, if_stmt)
*** 125,130 ****
--- 125,134 ----
else
{
emit_line_note (input_filename, lineno);
+ /* In "if (S &x = some_s())", we have a reference,
+ but need an indirect ref for the conversion. */
+ if (TREE_CODE (TREE_TYPE (cond)) == REFERENCE_TYPE)
+ cond = build_indirect_ref (cond, NULL);
expand_start_cond (condition_conversion (cond), 0);
}
}
More information about the Gcc-bugs
mailing list