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++/94628] [8/9/10 Regression] ICE in invalid_nonstatic_memfn_p at cp/typeck.c:1979 since r9-640-g1268ecc26fc1289b
Date: Mon, 20 Apr 2020 22:56:13 +0000	[thread overview]
Message-ID: <bug-94628-4-1pRUkPIcEt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94628-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from CVS 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:a3a4f6be0c7ac1536c4d1def14217840b04dd488

commit r10-7835-ga3a4f6be0c7ac1536c4d1def14217840b04dd488
Author: Patrick Palka <ppalka@redhat.com>
Date:   Mon Apr 20 18:34:00 2020 -0400

    c++: Recursive unification with packs and explicit targs [PR94628]

    This PR seems to be similar to PR c++/43382, except that the recursive call
to
    the variadic function with trailing return type in this testcase is
additionally
    given some explicit template arguments.

    In the first testcase below, when resolving the recursive call to 'select',
    fn_type_unification first substitutes in the call's explicit template
arguments
    before doing unification, and so during this substitution the template
argument
    pack for Args is incomplete.

    Since the pack is incomplete, the substitution of 'args...' in the trailing
    return type decltype(f(args...)) is handled by the unsubstituted_packs case
of
    tsubst_pack_expansion.  But the handling of this case happens _before_ we
reset
    local_specializations, and so the substitution ends up reusing the old
binding
    for 'args' from local_specializations rather than building a new one.

    This patch fixes this issue by setting up local_specializations sooner in
    tsubst_pack_expansion, before the handling of the unsubstituted_packs case.
    It also adds a new policy to local_specialization_stack so that we could
use the
    class here to conditionally replace local_specializations.

    gcc/cp/ChangeLog:

            PR c++/94628
            * cp-tree.h (lss_policy::lss_nop): New enumerator.
            * pt.c (local_specialization_stack::local_specialization_stack):
Handle
            an lss_nop policy.
            (local_specialization_stack::~local_specialization_stack):
Likewise.
            (tsubst_pack_expansion): Use a local_specialization_stack instead
of
            manually saving and restoring local_specializations.  Conditionally
            replace local_specializations sooner, before the handling of the
            unsubstituted_packs case.

    gcc/testsuite/ChangeLog:

            PR c++/94628
            * g++.dg/cpp0x/variadic179.C: New test.
            * g++.dg/cpp0x/variadic180.C: New test.

  parent reply	other threads:[~2020-04-20 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 21:41 [Bug c++/94628] New: segfault decltype roland at rschulz dot eu
2020-04-16 21:55 ` [Bug c++/94628] " mpolacek at gcc dot gnu.org
2020-04-17  6:35 ` [Bug c++/94628] [8/9/10 Regression] ICE in invalid_nonstatic_memfn_p at cp/typeck.c:1979 since r9-640-g1268ecc26fc1289b marxin at gcc dot gnu.org
2020-04-17  7:04 ` rguenth at gcc dot gnu.org
2020-04-18 14:41 ` ppalka at gcc dot gnu.org
2020-04-18 14:42 ` ppalka at gcc dot gnu.org
2020-04-18 22:00 ` xerofoify at gmail dot com
2020-04-18 23:36 ` mpolacek at gcc dot gnu.org
2020-04-19 14:42 ` ppalka at gcc dot gnu.org
2020-04-20  4:26 ` xerofoify at gmail dot com
2020-04-20  7:42 ` marxin at gcc dot gnu.org
2020-04-20 18:55 ` xerofoify at gmail dot com
2020-04-20 18:57 ` xerofoify at gmail dot com
2020-04-20 19:10 ` mpolacek at gcc dot gnu.org
2020-04-20 19:26 ` marxin at gcc dot gnu.org
2020-04-20 22:56 ` cvs-commit at gcc dot gnu.org [this message]
2020-04-20 22:57 ` [Bug c++/94628] [8/9 " ppalka at gcc dot gnu.org
2021-04-02 14:28 ` ppalka at gcc dot gnu.org
2021-05-04 12:32 ` rguenth at gcc dot gnu.org
2021-05-14  9:53 ` [Bug c++/94628] [9 " jakub at gcc dot gnu.org
2021-06-01  8:17 ` rguenth at gcc dot gnu.org
2022-05-27  8:51 ` 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-94628-4-1pRUkPIcEt@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).