This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: using directives crash
- To: brendan at cygnus dot com
- Subject: Re: using directives crash
- From: "Martin v. Loewis" <loewis at informatik dot hu-berlin dot de>
- Date: Wed, 3 Jun 1998 19:32:00 +0200
- Cc: egcs-patches at cygnus dot com
- References: <17135.896834548@lisa.cygnus.com>
> (just add the use of TYPE_DECL) it appears to do the trick. But I may be
> missing something else. ;)
This seems to work just fine, so it should be included. When (if) the
parser gets rewritten, maybe the interface of what is passed to
do_*_using_decl can be streamlined.
Martin
1998-06-03 Martin v. Löwis <loewis@informatik.hu-berlin.de>
Suggested by Brendan Kehoe
* decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL,
treat it as using ::decl.
Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.80
diff -c -p -r1.80 decl2.c
*** decl2.c 1998/06/01 18:25:32 1.80
--- decl2.c 1998/06/03 17:19:33
*************** do_toplevel_using_decl (decl)
*** 4386,4392 ****
scope = TREE_OPERAND (decl, 0);
name = TREE_OPERAND (decl, 1);
}
! else if (TREE_CODE (decl) == IDENTIFIER_NODE)
{
scope = global_namespace;
name = decl;
--- 4399,4406 ----
scope = TREE_OPERAND (decl, 0);
name = TREE_OPERAND (decl, 1);
}
! else if (TREE_CODE (decl) == IDENTIFIER_NODE
! || TREE_CODE (decl) == TYPE_DECL)
{
scope = global_namespace;
name = decl;