This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] PR 11702
> On Sat, 16 Aug 2003 13:02:51 +0200, Jan Hubicka <hubicka@ucw.cz> wrote:
>
> > Mark, still there is missing mark_used, does this look fine to you?
> > Sat Aug 16 12:59:13 CEST 2003 Jan Hubicka <jh@suse.cz>
> > PR C++/11702
> > * semantics.c (finish_id_expression): Mark all functions as used.
> > Index: semantics.c
> > ===================================================================
> > RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
> > retrieving revision 1.346
> > diff -c -3 -p -r1.346 semantics.c
> > *** semantics.c 15 Aug 2003 11:14:01 -0000 1.346
> > --- semantics.c 16 Aug 2003 10:59:05 -0000
> > *************** finish_id_expression (tree id_expression
> > *** 2555,2560 ****
> > --- 2555,2562 ----
> > (decl, scope, current_class_type));
> > if (TREE_CODE (decl) == FIELD_DECL || BASELINK_P (decl))
> > *qualifying_class = scope;
> > + if (TREE_CODE (decl) == FUNCTION_DECL)
> > + mark_used (decl);
> > else if (!processing_template_decl)
> > decl = convert_from_reference (decl);
> > else if (TYPE_P (scope))
>
> I don't think you want to insert that into the middle of an if/else chain.
> Put it at the end.
Thanks,
I've tested the attached patch. It also fixes the failure.
I am not quite sure whether the mark_used should be at the end. it
appears to me that the if chain is actually constructing the reference
to original decl so it should be in the front, but I don't quite
understand the code.
Sat Aug 16 12:59:13 CEST 2003 Jan Hubicka <jh@suse.cz>
PR C++/11702
* semantics.c (finish_id_expression): Mark all functions as used.
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.346
diff -c -3 -p -r1.346 semantics.c
*** semantics.c 15 Aug 2003 11:14:01 -0000 1.346
--- semantics.c 16 Aug 2003 17:32:49 -0000
*************** finish_id_expression (tree id_expression
*** 2553,2558 ****
--- 2553,2562 ----
{
decl = (adjust_result_of_qualified_name_lookup
(decl, scope, current_class_type));
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ mark_used (decl);
+
if (TREE_CODE (decl) == FIELD_DECL || BASELINK_P (decl))
*qualifying_class = scope;
else if (!processing_template_decl)