From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61EED3870C26; Tue, 22 Aug 2023 18:36:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61EED3870C26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692729418; bh=k8QsSPHeNq8Ej2bqAP3lhepQ+32nP4MfKMjycV+gkTM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ymcXWWqLbIXNszWu4lwpfZK3AXlvW+utioD+7vsbhd9Tk+krCNM7fY9RY0h9gsa+h Jou+VZtBHma0Duz5FBJXRZwxo00gG3juWXo4pd1DxOoGxbM68sER7aKiam5AtGMXVE lEBLw2GcR0x9l4snKpC44qPYmqu7JYjMy41hbIvI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109751] [13/14 Regression] boost iterator_interface fails concept check starting in gcc-13 Date: Tue, 22 Aug 2023 18:36:56 +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: 14.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: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109751 --- Comment #24 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:810bcc00156cefce7ad40fc9d8de6e43c3a04450 commit r14-3389-g810bcc00156cefce7ad40fc9d8de6e43c3a04450 Author: Jason Merrill Date: Thu Aug 17 11:36:23 2023 -0400 c++: constrained hidden friends [PR109751] r13-4035 avoided a problem with overloading of constrained hidden frien= ds by checking satisfaction, but checking satisfaction early is inconsistent = with the usual late checking and can lead to hard errors, so let's not do th= at after all. We were wrongly treating the different instantiations of the same friend template as the same function because maybe_substitute_reqs_for was fai= ling to actually substitute in the case of a non-template friend. But we do= n't actually need to do the substitution anyway, because [temp.friend] says that such a friend can't be the same as any other declaration. After fixing that, instead of a redefinition error we got an ambiguous overload error, fixed by allowing constrained hidden friends to coexist until overload resolution, at which point they probably won't be in the same ADL overload set anyway. And we avoid mangling collisions by following the proposed mangling for these friends as a member function with an extra 'F' before the name. I demangle this by just adding [friend] to the name of the function becau= se it's not feasible to reconstruct the actual scope of the function since= the mangling ABI doesn't distinguish between class and namespace scopes. PR c++/109751 gcc/cp/ChangeLog: * cp-tree.h (member_like_constrained_friend_p): Declare. * decl.cc (member_like_constrained_friend_p): New. (function_requirements_equivalent_p): Check it. (duplicate_decls): Check it. (grokfndecl): Check friend template constraints. * mangle.cc (decl_mangling_context): Check it. (write_unqualified_name): Check it. * pt.cc (uses_outer_template_parms_in_constraints): Fix for friends. (tsubst_friend_function): Don't check satisfaction. include/ChangeLog: * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_FRIEND. libiberty/ChangeLog: * cp-demangle.c (d_make_comp): Handle DEMANGLE_COMPONENT_FRIEND. (d_count_templates_scopes): Likewise. (d_print_comp_inner): Likewise. (d_unqualified_name): Handle member-like friend mangling. * testsuite/demangle-expected: Add test. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-friend11.C: Now works. Add template. * g++.dg/cpp2a/concepts-friend15.C: New test.=