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++/110006] [11/12/13/14 Regression] friend function template with constraint doesn't match existing declaration
Date: Sat, 03 Feb 2024 00:07:17 +0000	[thread overview]
Message-ID: <bug-110006-4-gmfzP15GKt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110006-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:686b5eb9c9ee623a604dde5c49fa11c23f384c62

commit r14-8770-g686b5eb9c9ee623a604dde5c49fa11c23f384c62
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Feb 2 19:07:08 2024 -0500

    c++: requires-exprs and partial constraint subst [PR110006]

    In r11-3261-gb28b621ac67bee we made tsubst_requires_expr never partially
    substitute into a requires-expression so as to avoid checking its
    requirements out of order during e.g. generic lambda regeneration.

    These PRs however illustrate that we still sometimes do need to
    partially substitute into a requires-expression, in particular when it
    appears in associated constraints that we're directly substituting for
    sake of declaration matching or dguide constraint rewriting.  In these
    cases we're being called from tsubst_constraint during which
    processing_constraint_expression_p is true, so this patch checks this
    predicate to control whether we defer substitution or partially
    substitute.

    In turn, we now need to propagate semantic tsubst flags through
    tsubst_requires_expr rather than just using tf_none, notably for sake of
    dguide constraint rewriting which sets tf_dguide.

            PR c++/110006
            PR c++/112769

    gcc/cp/ChangeLog:

            * constraint.cc (subst_info::quiet): Accomodate non-diagnostic
            tsubst flags.
            (tsubst_valid_expression_requirement): Likewise.
            (tsubst_simple_requirement): Return a substituted _REQ node when
            processing_template_decl.
            (tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
            flags.
            (tsubst_type_requirement): Return a substituted _REQ node when
            processing_template_decl.
            (tsubst_compound_requirement): Likewise.  Accomodate non-diagnostic
            tsubst flags.
            (tsubst_nested_requirement): Likewise.
            (tsubst_requires_expr): Don't defer partial substitution when
            processing_constraint_expression_p is true, in which case return
            a substituted REQUIRES_EXPR.
            * pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
            non-diagnostic tsubst flags.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-alias18.C: New test.
            * g++.dg/cpp2a/concepts-friend16.C: New test.

    Reviewed-by: Jason Merrill <jason@redhat.com>

  parent reply	other threads:[~2024-02-03  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-27 17:33 [Bug c++/110006] New: friend function template with NTTP and " services+gccbugs at vasama dot org
2023-06-16 20:44 ` [Bug c++/110006] friend function template with " waffl3x at protonmail dot com
2023-07-10  6:20 ` [Bug c++/110006] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-07-12 13:39 ` ppalka at gcc dot gnu.org
2024-01-12 13:56 ` rguenth at gcc dot gnu.org
2024-02-03  0:07 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-03  0:11 ` [Bug c++/110006] [11/12/13 " ppalka at gcc dot gnu.org
2024-02-03  0:13 ` ppalka at gcc dot gnu.org
2024-04-15 15:33 ` [Bug c++/110006] [11/12 " 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-110006-4-gmfzP15GKt@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).