This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH]: Fix bug 616
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Subject: Re: [C++ PATCH]: Fix bug 616
- From: Graham Stott <grahams at redhat dot com>
- Date: Fri, 17 Nov 2000 13:22:11 +0000
- CC: gcc-patches at gcc dot gnu dot org
- References: <3A1509BC.874A59B7@codesourcery.com>
Nathan Sidwell wrote:
>
> Hi,
> I've installed the attached which fixes bug 616. We weren't instantiating
> a decl's type during tsubsting.
>
> built & tested on i686-pc-linux-gnu, approved by Mark.
>
> nathan
> --
> Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
> 'But that's a lie.' - 'Yes it is. What's your point?'
> nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Nanthan
> 2000-11-17 Nathan Sidwell <nathan@codesourcery.com>
>
> * pt.c (tsubst_expr, DECL_STMT): Instantiate decl's type.
>
> 2000-11-17 Nathan Sidwell <nathan@codesourcery.com>
>
> * g++.old-deja/g++.pt/instantiate8.C: New test.
>
> Index: cp/pt.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/cp/pt.c,v
> retrieving revision 1.476
> diff -c -3 -p -r1.476 pt.c
> *** pt.c 2000/11/10 04:29:45 1.476
> --- pt.c 2000/11/17 10:18:37
> *************** tsubst_expr (t, args, complain, in_decl)
> *** 7150,7155 ****
> --- 7150,7158 ----
> init = tsubst_expr (init, args, complain, in_decl);
> if (decl != error_mark_node)
> {
> + if (TREE_CODE (decl) != TYPE_DECL)
> + /* Make sure the type is instantiated now. */
> + complete_type (type);
This change doesn't compile becuse type isn't defined!
I suspect ithis really needs to be
complete_type (TREE_TYPE (decl));
> if (init)
> DECL_INITIAL (decl) = error_mark_node;
> /* By marking the declaration as instantiated, we avoid
> [snip]
Graham