This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7181: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluatesto zero at compile time
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Nickolai Dobrynin <dobrynin at miller dot cs dot uwm dot edu>
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, dobrynin at bigfoot dot com, gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Jul 2002 23:17:19 +0200
- Subject: Re: c++/7181: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluatesto zero at compile time
- References: <Pine.GSO.4.33.0207021535070.18954-100000@miller.cs.uwm.edu>
Nickolai Dobrynin wrote:
I just think of it as being totally counter intuitive that the same nifty
feature is not valid (is NO LONGER valid, would be a better way to say it)
on non-constant initializers.
So, would indeed this be possible to restore the behavior of 2.95.x or it
would come in conflict with something else? Any opinions on that?
Nicolai, first thanks for your message from which I have learned much
about the issue at hand. On the other hand, I think that Mark's answer
stands: if the standard does /not/ prescribe a particular ordering this
cannot be considered a bug and, moreover, yourself proved that there is
a way (thanks, once more) to do this kind of tricks which does /not/
relies on not well-defined behavior. The latter two points imply that
most probably the old behaviour will not be restored very soon ;-)
PS Is it a normal behavior that the option -ftemplate-depth-... is no
longer needed in order for the example above to compile properly?
Yes. Currently the default max depth is 500:
2002-01-10 Jakub Jelinek <jakub@redhat.com>
* decl2.c (max_tinst_depth): Increase default limit to 500.
Ciao,
Paolo.