[Bug c++/12120] New: One specialization form not allowed in GCC 3.x (C++ 98: 14.7.3.9)

adah at netstd dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 1 02:10:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12120

           Summary: One specialization form not allowed in GCC 3.x (C++ 98:
                    14.7.3.9)
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: adah at netstd dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: minw32
  GCC host triplet: minw32
GCC target triplet: minw32

This is a platform-independent bug.  I confirmed that it exists at least also 
in gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).

My gcc configuration options:

Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --
host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --
enable-languages=c,c++,f77,objc,ada,java --disable-win32-registry --disable-
shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x -
-enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-
synchronization
Thread model: win32
gcc version 3.3.1 (mingw special 20030804-1)

According to C++ standard 14.7.3.9, specializations in the forms "namespace xxx 
{ template<> class yyy<special> ... }" and "template<> class 
xxx::yyy<special> ..." are both allowed.  Apparently GCC only accepts the 
former form.  The latter form will trigger an error like "specializing `struct 
__gnu_cxx::hash<my_obj>' in different namespace".

Some examples are given in
http://gcc.gnu.org/ml/gcc/2003-08/msg01780.html



More information about the Gcc-bugs mailing list