This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16564] g++ seems to go into an infinite loop after errors
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2004 17:14:36 -0000
- Subject: [Bug c++/16564] g++ seems to go into an infinite loop after errors
- References: <20040715110539.16564.steven@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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