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

            Bug ID: 113908
           Summary: [14 Regression] bogus access error with new-expr of
                    current non-template class with implicitly deleted
                    copy ctor
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

struct B {
  B() = default;
private:
  B(const B&);
};

struct A {
  B b;

  template<class T>
  static void f() { new A(); }
};

int main() {
  A::f<int>();
}

<stdin>: In instantiation of ‘static void A::f() [with T = int]’:
<stdin>:15:12:   required from here
<stdin>:11:27: error: ‘B::B(const B&)’ is private within this context
<stdin>:4:3: note: declared private here
<stdin>:11:27: error: ‘B::B(const B&)’ is private within this context
<stdin>:4:3: note: declared private here

Reply via email to