This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: Fix PR2984
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: C++ PATCH: Fix PR2984
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Fri, 08 Jun 2001 14:55:49 +0100
- CC: gcc-patches at gcc dot gnu dot org
- Organization: Codesourcery LLC
- References: <20010607190739W.mitchell@codesourcery.com>
Mark Mitchell wrote:
> 2001-06-07 Mark Mitchell <mark@codesourcery.com>
>
> * decl.c (duplicate_decls): Update source position information
> when a template function is defined.
This broke the mainline, because you should have used DECL_TEMPLATE_RESULT
(checking is turned off on the branch, which is why you saw no problem).
I've installed the attached on both branch and mainline.
This gets the bootstrap past stdexcept.cc, which is where it was dieing.
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
2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (duplicate_decls): Fix DECL_TEMPLATE_RESULT thinko
in previous change.
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.792
diff -c -3 -p -r1.792 decl.c
*** decl.c 2001/06/08 02:05:04 1.792
--- decl.c 2001/06/08 13:47:35
*************** duplicate_decls (newdecl, olddecl)
*** 3501,3514 ****
/* If the new declaration is a definition, update the file and
line information on the declaration. */
! if (DECL_INITIAL (DECL_RESULT (olddecl)) == NULL_TREE
! && DECL_INITIAL (DECL_RESULT (newdecl)) != NULL_TREE)
{
DECL_SOURCE_LINE (olddecl)
! = DECL_SOURCE_LINE (DECL_RESULT (olddecl))
= DECL_SOURCE_LINE (newdecl);
DECL_SOURCE_FILE (olddecl)
! = DECL_SOURCE_FILE (DECL_RESULT (olddecl))
= DECL_SOURCE_FILE (newdecl);
}
--- 3501,3514 ----
/* If the new declaration is a definition, update the file and
line information on the declaration. */
! if (DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)) == NULL_TREE
! && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) != NULL_TREE)
{
DECL_SOURCE_LINE (olddecl)
! = DECL_SOURCE_LINE (DECL_TEMPLATE_RESULT (olddecl))
= DECL_SOURCE_LINE (newdecl);
DECL_SOURCE_FILE (olddecl)
! = DECL_SOURCE_FILE (DECL_TEMPLATE_RESULT (olddecl))
= DECL_SOURCE_FILE (newdecl);
}