From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2EF13857700; Sun, 7 May 2023 14:30:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2EF13857700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683469800; bh=aUQwC+4n6ED++nxcakzaFAIsLgy2lVkS5SL6CAZpNSE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nGs7sL1ncgMAMd1JxSV5G5QPXVG2MEvp3xg1RhYcmrl5zSku/xiWX97d+xk1662bv WP5N9c7ZLlLbJboVd4aOg6ef2dg7dgsqR0AXKTIwGb8x+t9+tPw+5zqwCD2xi2JyDz hJroI6mltsjhqxIobUgv11XUhGIp1FEHaHGHY5jw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109480] [11/12/13/14 Regression] non-depedent access goes wrong in a template method sometimes since r11-1350-g92bed036098928 Date: Sun, 07 May 2023 14:30:00 +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: 11.3.0 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: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109480 --- Comment #5 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:681ba2f7681f295a102cd63ffd5ce2b86a5f706e commit r14-557-g681ba2f7681f295a102cd63ffd5ce2b86a5f706e Author: Patrick Palka Date: Sun May 7 10:24:52 2023 -0400 c++: non-dep init folding and access checking [PR109480] enforce_access currently checks processing_template_decl to decide whether to defer the given access check until instantiation time. But using this flag is unreliable because it gets cleared during e.g. non-dependent initializer folding, and so can lead to premature access check failures as in the below testcase. It seems better to check current_template_parms instead. PR c++/109480 gcc/cp/ChangeLog: * semantics.cc (enforce_access): Check current_template_parms instead of processing_template_decl when deciding whether to defer the access check. gcc/testsuite/ChangeLog: * g++.dg/template/non-dependent25a.C: New test.=