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]
Other format: [Raw text]

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


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