public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-109751-4-nwymYHvwyk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109751-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109751

--- Comment #24 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:810bcc00156cefce7ad40fc9d8de6e43c3a04450

commit r14-3389-g810bcc00156cefce7ad40fc9d8de6e43c3a04450
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Aug 17 11:36:23 2023 -0400

    c++: constrained hidden friends [PR109751]

    r13-4035 avoided a problem with overloading of constrained hidden friends
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 that
    after all.

    We were wrongly treating the different instantiations of the same friend
    template as the same function because maybe_substitute_reqs_for was failing
    to actually substitute in the case of a non-template friend.  But we don'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 because
    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.

  parent reply	other threads:[~2023-08-22 18:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 17:45 [Bug libstdc++/109751] New: boost interface_interface " ldalessandro at gmail dot com
2023-05-05 17:50 ` [Bug c++/109751] boost iterator_interface " pinskia at gcc dot gnu.org
2023-05-05 17:59 ` ldalessandro at gmail dot com
2023-05-05 18:06 ` ldalessandro at gmail dot com
2023-05-05 18:09 ` pinskia at gcc dot gnu.org
2023-05-05 18:11 ` ldalessandro at gmail dot com
2023-05-05 18:14 ` pinskia at gcc dot gnu.org
2023-05-05 18:41 ` pinskia at gcc dot gnu.org
2023-05-05 18:54 ` ldalessandro at gmail dot com
2023-05-05 19:00 ` pinskia at gcc dot gnu.org
2023-05-05 19:24 ` pinskia at gcc dot gnu.org
2023-05-05 20:01 ` pinskia at gcc dot gnu.org
2023-05-05 20:02 ` pinskia at gcc dot gnu.org
2023-05-06 22:02 ` redi at gcc dot gnu.org
2023-05-06 22:05 ` redi at gcc dot gnu.org
2023-05-06 23:28 ` ldalessandro at gmail dot com
2023-05-08 15:46 ` ldalessandro at gmail dot com
2023-05-08 16:00 ` redi at gcc dot gnu.org
2023-05-09 19:20 ` ppalka at gcc dot gnu.org
2023-05-09 21:24 ` [Bug c++/109751] [13/14 Regression] " ppalka at gcc dot gnu.org
2023-05-09 21:27 ` ppalka at gcc dot gnu.org
2023-05-10 19:10 ` ppalka at gcc dot gnu.org
2023-07-21 14:09 ` ppalka at gcc dot gnu.org
2023-07-27  9:26 ` rguenth at gcc dot gnu.org
2023-08-17 15:52 ` jason at gcc dot gnu.org
2023-08-22 18:36 ` cvs-commit at gcc dot gnu.org [this message]
2023-08-31 22:40 ` cvs-commit at gcc dot gnu.org
2023-08-31 22:40 ` jason at gcc dot gnu.org
2023-10-16 18:33 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109751-4-nwymYHvwyk@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).