This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 'curiously recursive template' example
- To: binkley at bigfoot dot com
- Subject: Re: 'curiously recursive template' example
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 02 Jul 1999 01:53:39 -0300
- Cc: egcs-bugs at egcs dot cygnus dot com
- References: <37796E2C.75650A1D@bigfoot.com>
On Jun 29, 1999, "B. K. Oxley (binkley) at Home" <binkley@bigfoot.com> wrote:
> template<class T> struct FuncPtr_helper
> { typedef typename T::f (*f) ( ); };
> struct FuncPtr_typedef : FuncPtr_helper<FuncPtr_typedef> { }
> main.cc:7: Internal compiler error.
Thanks for your bug report. The upcoming gcc 2.95 will report:
main.cc: In instantiation of `FuncPtr_helper<FuncPtr_typedef>':
main.cc:7: instantiated from here
main.cc:3: invalid use of undefined type `struct FuncPtr_typedef'
main.cc:6: forward declaration of `struct FuncPtr_typedef'
main.cc:9: syntax error before `;'
And a few other errors caused by these. In fact, because
FuncPtr_helper requires its argument to be a complete type,
FuncPtr_helper<FuncPtr_typedef> can't be instantiated before
FuncPtr_typedef is fully defined, so the template instantiation can't
be used as a base class.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists