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: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: paolo at gcc dot gnu dot org, dobrynin at bigfoot dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Mon, 01 Jul 2002 23:58:26 +0200
- Subject: Re: c++/7181: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluatesto zero at compile time
- References: <20020701212006.8098.qmail@sources.redhat.com> <3D20CEBD.6A0D6C57@codesourcery.com>
Nathan Sidwell wrote:
paolo@gcc.gnu.org wrote:
Synopsis: foo<n>::bar = foo<n-1>::bar + foo<n-2>::bar evaluates to zero at
FYI, this is broken in 2.96RH too, so is quite old. The static initializers
are emitted in the wrong order so we initialize foo<n> before foo<n-1>. doh!
Thanks for your feedback.
You agree, I suppose, that is quite embarassing that g++ is no longer
able to correctly compile the textbook example of template
metaprogramming :-(
Paolo.