This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24173] [4.0/4.1/4.2 regression] ICE with garbage collection
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2005 23:08:47 -0000
- Subject: [Bug c++/24173] [4.0/4.1/4.2 regression] ICE with garbage collection
- References: <bug-24173-11451@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2005-11-29 23:08 -------
Shorter testcase:
template <typename T> struct F;
template <typename T> F<T> &operator<<(F<T>&, const char*);
template<typename T>
struct F
{
friend F& operator<< <>(F&, const char*);
};
typedef F<char> F1;
template<typename> struct X;
typedef X<int> X2;
F1& operator<< (F1&, const X2&);
template<typename> struct X
{
static void foo();
friend F1& operator<< (F1&, const X2&);
};
template<typename T>void X<T>::foo()
{
F1 g;
g <<"";
}
-----
Commenting out the following ggc_free:
/* The NEWDECL will no longer be needed. Because every out-of-class
declaration of a member results in a call to duplicate_decls,
freeing these nodes represents in a significant savings. */
ggc_free (newdecl);
makes the testcase to work.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24173