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

            Bug ID: 104747
           Summary: ICE: in enforce_access, at cp/semantics.c:302
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

This only triggers in gcc-modules:

template<class V>
class A {
  int y_;
  class B {
    class C {
      A* z_;
      friend bool operator==(C& x, int) {
        return x.z_->y_;
      }
    };
  };
};

https://godbolt.org/z/dW561Mdo5

Reply via email to