Member specialisation bug (?) in 3.3 (C++)

Kriang Lerdsuwanakij lerdsuwa@users.sf.net
Sun May 18 12:18:00 GMT 2003


It's a bug.  I add this to my to-do list for bugs to fix for GCC 3.3.1.

--Kriang


Ole Laursen wrote:
> Hi,
> 
> Debian has switched to GCC 3.3 for unstable which renders programs
> that use gtkmm unusable. The problem is that a certain member template
> specialisation pattern is used in the headers. The problem can be
> reproduced with the following snippet:
> 
>   class X
>   {
>   private:
>     template <typename T> struct Y;   // line 4
>   };
> 
>   template <> struct X::Y<int>
>   {                                   // line 8
>   };
> 
>   int main()
>   {
>   }
> 
> Compiling this with GCC 3.3 gives
> 
>   $ g++ -o test test.c++ -Wall
>   test.c++:4: error: `template<class T> struct X::Y' is private
>   test.c++:8: error: within this context
> 
> whereas it worked with 3.2. Is this a bug in the compiler or is
> specialisation of private template members simply not possible in C++?
> 





More information about the Gcc mailing list