egcs-g++-971215: template specialization problem
Mark Mitchell
mmitchell@usa.net
Thu Dec 18 12:14:00 GMT 1997
Dirk --
>>>>> "Dirk" == Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:
Dirk> The following code does not compile:
>> cat test.cc
Dirk> template <class T> struct X { virtual void f(int) const; };
Dirk> template <class T> struct Y: public X<T> { virtual void
Dirk> f(int) const; };
Dirk> template <class T> void Y<T>::f(int) const { }
Dirk> template <> void Y<bool>::f(int) const;
>> g++ test.cc
Dirk> test.cc:19: prototype for `void Y<bool>::f(int) const' does
Dirk> not match any in class `X<bool>' test.cc:4: candidate is:
Dirk> void X<bool>::f(int) const
This works fine for me, so I think that this patch:
http://www.cygnus.com/ml/egcs/1997-Dec/0967.html
fixed the problem. Please give that a try and see if it helps.
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu
More information about the Gcc-bugs
mailing list