This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16564] g++ goes into an infinite loop after errors


------- Additional Comments From bangerth at dealii dot org  2004-07-15 12:49 -------
That's likely the smallest possible testcase: 
----------------- 
template <typename T> struct A {}; 
 
template <typename T> struct S { 
    S<A<T> > non_type; 
    typedef non_type type; 
}; 
 
S<int> m; 
----------------- 
Of course the typedef can't succeed (since the named type is not 
a type at all): 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.ii  
x.ii:5: error: `non_type' does not name a type 
 
However, after this error message we get into an endless loop. 
 
This error exists in one form or other since at least 2.95. Some versions 
on my harddisk show messages like 
x.ii:5:   instantiated from `S<A<A<A<A<A<A<A<A<A<A<A<int> > > > > > > > > > > 
>' 
over and over again, which may give an indication as to what is going wrong. 
 
W. 

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]