From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3E9823850407; Thu, 30 Jul 2020 02:15:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E9823850407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596075318; bh=LxfWx2j0lwkuc4zdlAW40tcZY69DcZwRAn+IR0QxTgY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JSsvq5vHWwX6FnVIlDNM0hy7uXgifo+4UR7R2zGm0WEaKNRO0FdPTWabjyau52UuB yJbOa0tMBAV7hvGHBmdLQ1L0VkuqdiIj4ZxSQs6Jb9FmK3WExn5WAYRi5m42YO8xBU cPAjXjHPQ19d4jdlokCuIk7pLZxMmVRFgKBky+DQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96106] [10/11 Regression] A friend abbreviated template function denies access to private members Date: Thu, 30 Jul 2020 02:15:18 +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.1.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: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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, 30 Jul 2020 02:15:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96106 --- Comment #3 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:f31dd9beb95f4beda1d2bd5c0526c42d0ce455c4 commit r11-2418-gf31dd9beb95f4beda1d2bd5c0526c42d0ce455c4 Author: Patrick Palka Date: Wed Jul 29 22:06:36 2020 -0400 c++: abbreviated function template friend matching [PR96106] In the below testcase, duplicate_decls wasn't merging the tsubsted friend declaration for 'void add(auto)' with its definition, because reduce_template_parm_level (during tsubst_friend_function) lost the DECL_VIRTUAL_P flag on the auto's invented template parameter, which caused template_heads_equivalent_p to deem the two template heads as not equivalent in C++20 mode. This patch makes reduce_template_parm_level carry over the DECL_VIRTUAL_P flag from the original TEMPLATE_PARM_DECL. gcc/cp/ChangeLog: PR c++/96106 * pt.c (reduce_template_parm_level): Propagate DECL_VIRTUAL_P from the original TEMPLATE_PARM_DECL to the new lowered one. gcc/testsuite/ChangeLog: PR c++/96106 * g++.dg/concepts/abbrev7.C: New test.=