This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

egcs-g++-971215: template specialization problem



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]