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++/85282] New: CWG 727 (full specialization in non-namespace scope)


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282

            Bug ID: 85282
           Summary: CWG 727 (full specialization in non-namespace scope)
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: songyuanyao at qq dot com
  Target Milestone: ---

According to CWG 727, the following code should be accepted; i.e. full
specialization may be declared inside class definition.

struct A {
  template<class T> struct B;
  template <> struct B<int*> { };
};

And per [temp.expl.spec] paragraph 2,

An explicit specialization may be declared in any scope in which the
corresponding primary template may be defined ([namespace.memdef], [class.mem],
[temp.mem]).

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