https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96673
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[9/10 Regression] Friend |[9 Regression] Friend class |class with templates and |with templates and default |default constructor not |constructor not recognized |recognized in C++14 or |in C++14 or later |later | --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:e0cc2713a4076edd4f20b80b0fe217c9ab1676b2 commit r9-10164-ge0cc2713a4076edd4f20b80b0fe217c9ab1676b2 Author: Jason Merrill <ja...@redhat.com> Date: Tue Apr 6 15:13:02 2021 -0400 c++: access checking in aggregate initialization [PR96673] We were deferring access checks while parsing B<int>{}, didn't adjust that when we went to instantiate the default member initializer for B::c, deferred access checking for C::C, and then checked it after parsing B<int>{}, back in the main() context which has no access. We need to do the access checks in the class context of the DMI. I tried fixing this in push_to/pop_from_top_level, but that caused several regressions. gcc/cp/ChangeLog: PR c++/96673 * init.c (get_nsdmi): Don't defer access checking. gcc/testsuite/ChangeLog: PR c++/96673 * g++.dg/cpp1y/nsdmi-aggr13.C: New test.