[Bug c++/31863] [4.1/4.2/4.3 Regression] g++-4.1: out of memory with -O1/-O2

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Sep 18 11:58:00 GMT 2007



------- Comment #17 from rguenth at gcc dot gnu dot org  2007-09-18 11:58 -------
Note that the double virtual inheritance in the Serializer template creates the
exponential behavior.  You can fix this at the source level by instead
doing

template <class Key, class Head>
class Serializer<Key, Loki::Typelist<Head, Loki::NullType> >:
    public virtual Serializer<Key, Head>
{
};

template <class Key, class Head, class Tail>
class Serializer<Key, Loki::Typelist<Head, Tail> >:
    public virtual Serializer<Key, Head>,
    public Serializer<Key, Tail>
{
};

template <class Key>
class Serializer<Key, Loki::NullType> : public virtual Factory<Key>
{
};

which also makes more sense(?).  Back to marking this as possibly a C++
frontend bug - though I'm inclined to close this bug as INVALID.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |c++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31863



More information about the Gcc-bugs mailing list