This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: A Specialization Bug
- From: adah at sh163 dot net
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 29 Dec 2001 08:32:22 GMT
- Subject: Re: A Specialization Bug
Things are more complicated than I thought. My previous posting did
not prove gcc has the bug. In fact, the following code will compile
under gcc 2.95.3:
---------------------------------------------------------------------
namespace N {
template<class T> class X { /* ... */ };
template<class T> class Y { /* ... */ };
template<> class X<int> { /* ... */ }; // ok: specialization
// in same namespace
template<> class Y<double>; // forward declare intent to
// specialize for double
}
template<> class N::Y<double> { /* ... */ }; // ok: specialization
// in same namespace
---------------------------------------------------------------------
Comment l. 7 and gcc will fail. Now Visual C++ and Borland C++ still
can compile. However, this behaviour is not required by the C++
standard.
So this seems not a bug.
Best regards,
Wu Yongwei