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++/107864] [10/11/12 Regression] ICE (seg fault) in check_return_expr or instantiate_body with concepts and specialized version
Date: Tue, 07 Mar 2023 02:18:20 +0000	[thread overview]
Message-ID: <bug-107864-4-awSS5VyFfm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107864-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:18bd59990196462cde8011458e2518118b1b6681

commit r12-9228-g18bd59990196462cde8011458e2518118b1b6681
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Nov 29 09:55:21 2022 -0500

    c++: explicit specialization and trailing requirements [PR107864]

    Here we're crashing when using the explicit specialization of the
    function template g with trailing requirements ultimately because
    earlier decls_match (called indirectly from register_specialization) for
    for the explicit specialization returned false since the template has
    trailing requirements whereas the specialization doesn't.

    In r12-2230-gddd25bd1a7c8f4, we fixed a similar issue concerning template
    requirements instead of trailing requirements.  We could extend that fix
    to ignore trailing requirement mismatches for explicit specializations
    as well, but it seems cleaner to just propagate constraints from the
    specialized template to the specialization when declaring an explicit
    specialization so that decls_match will naturally return true in this
    case.  And it looks like determine_specialization already does this,
    albeit inconsistently (only when specializing a non-template member
    function of a class template as in cpp2a/concepts-explicit-spec4.C).

    So this patch makes determine_specialization consistently propagate
    constraints from the specialized template to the specialization, which
    in turn lets us get rid of the function_requirements_equivalent_p special
    case added by r12-2230.

            PR c++/107864

    gcc/cp/ChangeLog:

            * decl.cc (function_requirements_equivalent_p): Don't check
            DECL_TEMPLATE_SPECIALIZATION.
            * pt.cc (determine_specialization): Propagate constraints when
            specializing a function template too.  Simplify by using
            add_outermost_template_args.

    gcc/testsuite/ChangeLog:

            * g++.dg/concepts/explicit-spec1a.C: New test.

    (cherry picked from commit 36cabc257dfb7dd4f7625896891f6c5b195a0241)

  parent reply	other threads:[~2023-03-07  2:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 19:17 [Bug c++/107864] New: Internal Compiler Error (Large Project, C++20) ian at geometrian dot com
2022-11-24 19:38 ` [Bug c++/107864] " pinskia at gcc dot gnu.org
2022-11-24 21:40 ` pinskia at gcc dot gnu.org
2022-11-24 21:42 ` pinskia at gcc dot gnu.org
2022-11-24 21:48 ` pinskia at gcc dot gnu.org
2022-11-24 21:51 ` [Bug c++/107864] [10/11/12/13 Regression] ICE (seg fault) in check_return_expr with concepts and specialized version pinskia at gcc dot gnu.org
2022-11-24 21:55 ` [Bug c++/107864] [10/11/12/13 Regression] ICE (seg fault) in check_return_expr or instantiate_body " pinskia at gcc dot gnu.org
2022-11-25  0:11 ` redi at gcc dot gnu.org
2022-11-28 16:23 ` ppalka at gcc dot gnu.org
2022-11-29 14:55 ` cvs-commit at gcc dot gnu.org
2022-11-29 15:06 ` [Bug c++/107864] [10/11/12 " ppalka at gcc dot gnu.org
2023-03-07  2:18 ` cvs-commit at gcc dot gnu.org [this message]
2023-05-22  3:12 ` [Bug c++/107864] [10/11 " cvs-commit at gcc dot gnu.org
2023-07-07 10:04 ` [Bug c++/107864] [10 " rguenth 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-107864-4-awSS5VyFfm@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).