[Bug c++/56480] New: Explicit specialization in a namespace enclosing the specialized template

zeratul976 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 28 08:18:00 GMT 2013


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

             Bug #: 56480
           Summary: Explicit specialization in a namespace enclosing the
                    specialized template
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeratul976@hotmail.com


The following code:


namespace Foo 
{
    template <typename T>
    struct Meow
    {
    };
}

template <>
struct Foo::Meow<int>
{
};


fails to compile with gcc 4.8 (tested with 20130224 snapshot). 

I believe this code should be accepted in C++11 mode as per [temp.expl.spec]
p2: "An explicit specialization shall be declared in a namespace enclosing the
specialized template." This is a relaxation of the C++03 wording: "An explicit
specialization shall be declared in the namespace of which the template is a
member".

Recent versions of clang and MSVC compile the above code in C++11 mode.



More information about the Gcc-bugs mailing list