bug with self referencing templates
Alexandre Oliva
oliva@dcc.unicamp.br
Wed Mar 31 23:54:00 GMT 1999
On Mar 25, 1999, Stefan Seefeld <seefelds@MAGELLAN.UMontreal.CA> wrote:
> type/value mismatch at argument 1 in template parameter list for `template <class T> Event<T>'
> template <class T, class A> class Event { public: /*...*/ };
> template <class A> class MouseEvent : public Event<MouseEvent, A> {
> Shouldn't this work ?
Nope, but the error message could certainly be improved. [class]/2
says that a class-name is inserted into the declaration scope just
after the class-name is seen, and also into its own scope. Then,
[temp.local]/1 says that, *within the scope* of a class template, the
name of the template without explicit arguments is equivalent to the
template-name followed by the template-parameters enclosed in <>.
Since the base class names are not looked up within the class scope,
you can't leave `<A>' out in this case.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,egcs.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists
More information about the Gcc-bugs
mailing list