https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106178
Bug ID: 106178 Summary: [13 Regression] Rejected code with "is private within this context" since r13-1390-g07ac550393d00fca Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- Seen in blender package, where the following test-case is rejected now: $ cat hull.ii class btConvexHullInternal { template <typename> struct PoolArray {}; template <typename T> struct Pool { Pool() { PoolArray<T> *p; p->~PoolArray<T>(); } }; Pool<int> edgePool; }; void compute() { btConvexHullInternal hull; } $ g++ hull.ii -c hull.ii: In instantiation of ‘btConvexHullInternal::Pool<T>::Pool() [with T = int]’: hull.ii:1:7: required from here hull.ii:6:22: error: ‘template<class> struct btConvexHullInternal::PoolArray’ is private within this context 6 | p->~PoolArray<T>(); | ~~~~~~~~~~~~~~~^ hull.ii:2:30: note: declared private here 2 | template <typename> struct PoolArray {}; | ^~~~~~~~~ Started with r13-1390-g07ac550393d00fca.