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]

[Bug c++/26782] New: reject [valid?] template specialization.


namespace A { namespace B {
template < typename T > void foo();
} }

struct S1;
struct S2;

namespace A { namespace B {
template <> void foo< S1 >();  // accepted
} }

template <> void A::B::foo< S2 >(); // rejected


$ g++ bug.cpp -c -Wall
error: specialization of &#8216;template<class T> void A::B::foo()&#8217;
         in different namespace
error: from definition of &#8216;template<class T> void A::B::foo()&#8217;


this testcase works with g++ 3.3.6 and vs-2003.


-- 
           Summary: reject [valid?] template specialization.
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
 GCC build triplet: *
  GCC host triplet: *
GCC target triplet: *


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


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