PATCH for Re: foo.cc:15: Internal compiler error.

Alexandre Oliva oliva@dcc.unicamp.br
Mon May 25 09:25:00 GMT 1998


Mark Mitchell <mark@markmitchell.com> writes:

>   template <class A*> void f();

> declares an (anonymous) non-type parameter of type `class A*', and
> forward-declares `class A'.  Would you believe it?

IMO, it shouldn't forward-declare `class A'; this code should only be
accepted if `class A' is declared already.  Although not explicitly
stated in section [temp.param], this requirement is implied in the
last sentence of [dcl.type.elab]/3:

                    If name lookup does not find a declaration  for  the
  name,  the elaborated-type-specifier is ill-formed unless it is of the
  simple form class-key identifier  in  which  case  the  identifier  is
  declared as described in _basic.scope.pdecl_.

Perhaps we should take this to comp.std.c++ ?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list