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

            Bug ID: 106756
           Summary: Overbroad friendship for nested classes
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: herring at lanl dot gov
  Target Milestone: ---

Sometime since 12.2, GCC has started accepting

struct A {
  struct B {
    friend int f(B*) {return i;}
  };
private:
  static int i;
};

despite the express limitation in [class.nest]/4 (/3 in the latest draft). 
(Current Clang also accepts it, but ICC and MSVC do not.)

Reply via email to