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

            Bug ID: 86747
           Summary: [8/9 Regression] rejects-valid with redundant friend
                    declaration
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

template <class> class A {
  typedef A vector_type;
  template <void (vector_type::*)()> class C;
  template <void (vector_type::*)()> friend class C;
};

int main() { A<double> a; }

is rejected starting with r255780 aka PR59930 fix.

f.C: In instantiation of ‘class A<double>’:
f.C:7:24:   required from here
f.C:3:35: error: template parameter ‘void (A< <template-parameter-1-1> >::*
<anonymous>)()’
   template <void (vector_type::*)()> class C;
                                   ^
f.C:4:51: error: redeclared here as ‘void (A<double>::* <anonymous>)()’
   template <void (vector_type::*)()> friend class C;
                                                   ^
The friend declaration is redundant but we used to accept this, and so does
clang.

Reply via email to