[Bug c++/14507] [3.3 Regression] Wacky Template ICE

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Tue Mar 9 20:36:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list