[Bug c++/16564] g++ seems to go into an infinite loop after errors

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 18 17:14:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-10-18 17:14 -------
Ah, never mind. I had misread my own example in that I thought that the 
instantiation of S<T> only required instantiation of A<T>, but in 
fact it also requires S<A<T> > which requires S<A<A<T> > >, etc, so we 
do have in fact an infinite list of instantiations. 
 
In that case, I don't even know whether we should consider this a bug: I 
would say the compiler is clearly doing something useful with your testcase 
(and with mine as well) in that it tries to go down the list of instantiations 
that the code clearly prescribes. Your testcase has no problem except the 
infinite list of instantiations, so there isn't very much the compiler can 
do differently apart from throttling the limit somewhat. 
 
So, what are we supposed to do? As mentioned in the patch you cite, 
-ftemplate-depth-50 is not enough, so 500 seems a reasonable choice.  
What value would you suggest instead? 
 
W. 

-- 


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



More information about the Gcc-bugs mailing list