From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 91B6A398B179; Thu, 20 May 2021 21:35:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91B6A398B179 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96673] [9/10 Regression] Friend class with templates and default constructor not recognized in C++14 or later Date: Thu, 20 May 2021 21:35:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 21:35:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96673 --- Comment #6 from CVS Commits --- The releases/gcc-10 branch has been updated by Jason Merrill : https://gcc.gnu.org/g:e206f71eaf98149224269b00407bc5def6ae2dca commit r10-9848-ge206f71eaf98149224269b00407bc5def6ae2dca Author: Jason Merrill Date: Tue Apr 6 15:13:02 2021 -0400 c++: access checking in aggregate initialization [PR96673] We were deferring access checks while parsing B{}, didn't adjust t= hat 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{}, 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 seve= ral 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.=