C++ PATCH for c++/3870

Jason Merrill jason@redhat.com
Mon Mar 18 06:33:00 GMT 2002


In g++.dg/template/spec3.C, the value saved in last_function_parms was
clobbered even before grokdeclarator returned, because the check to see
what it's a specialization of caused the instantiation of a class, which
involves grokking the declarators for the synthesized methods.

The simple fix is to save last_function_parms around a template
instantiation.  Eventually, last_function_parms should die.

Tested i686-pc-linux-gnu.  Applied trunk, 3.0 and 3.1.

2002-03-18  Jason Merrill  <jason@redhat.com>

	PR c++/3870
	* cp-tree.h (struct saved_scope): Add last_parms field.
	* decl.c (maybe_push_to_top_level): Save last_function_parms.
	(pop_from_top_level): Restore it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 966 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020318/da9e7193/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spec3.C
Type: text/x-c++
Size: 326 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020318/da9e7193/attachment-0001.bin>


More information about the Gcc-patches mailing list