This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14507] [3.3 Regression] Wacky Template ICE
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Mar 2004 20:36:23 -0000
- Subject: [Bug c++/14507] [3.3 Regression] Wacky Template ICE
- References: <20040309192501.14507.stl@caltech.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-03-09 20:36 -------
Wow, yes, this _is_ wacky. However, it should be legal.
Not surprisingly, the cause of death of previous compilers is due to
memory starvation after expanding like a dying star on my machine. What
happens is that apparently it tries to expand the inheritance tree without
seeing that there is a partial specialization around. For, if I change the
example to this:
-----------------
template <typename A, typename B = int, typename C = int, typename D = int>
struct c;
template <typename A, typename B, typename C>
struct c<A, B, C, int> : c<A, B> {
c() : c() { }
};
template <typename A, typename B, typename C, typename D>
struct c : virtual c<A, B> { };
----------------
then it compiles fine. However, in both cases the code may not be legal
since the class hierarchy is actually infinite. The only difference between
seeing the partial specialization and not seeing it is that in one case
it tries to do all the inheritance with virtual base classes, and in the
other case with non-virtual ones.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |memory-hog
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14507