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++/99806] [10 Regression] ICE: in tsubst_copy, at cp/pt.c:17247
Date: Fri, 09 Apr 2021 22:47:51 +0000	[thread overview]
Message-ID: <bug-99806-4-DYQsvKKWTl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99806-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:8f4f2fbc17c2a225c29ea20a2b6046cbdc7b3155

commit r10-9691-g8f4f2fbc17c2a225c29ea20a2b6046cbdc7b3155
Author: Marek Polacek <polacek@redhat.com>
Date:   Thu Apr 8 14:39:28 2021 -0400

    c++: Fix two issues with auto function parameter [PR99806]

    When we have a member function with auto parameter like this:

      struct S {
        void f(auto);
      };

    cp_parser_member_declaration -> grokfield produces a FUNCTION_DECL
    "void S::foo(auto:1)", and then finish_fully_implicit_template turns
    that FUNCTION_DECL into a TEMPLATE_DECL.  The bug here is that we only
    call cp_parser_save_default_args for a FUNCTION_DECL.  As a consequence,
    abbrev10.C is rejected because we complain that the default argument has
    not been defined, and abbrev11.C ICEs, because we don't re-parse the
    delayed noexcept, so the DEFERRED_PARSE tree leaks into tsubst* where we
    crash.  This patch fixes both issues.

    gcc/cp/ChangeLog:

            PR c++/99806
            * parser.c (cp_parser_member_declaration): Call
            cp_parser_save_default_args even for function templates.  Use
            STRIP_TEMPLATE on the declaration we're passing.

    gcc/testsuite/ChangeLog:

            PR c++/99806
            * g++.dg/concepts/abbrev10.C: New test.
            * g++.dg/concepts/abbrev11.C: New test.

    (cherry picked from commit 625dadaf5df5a2ae0d8c5660fd1eec8ba354479c)

  parent reply	other threads:[~2021-04-09 22:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29  4:53 [Bug c++/99806] New: ICE in tsubst_copy of gcc-trunk and tree_code_size of gcc-10 hewillk at gmail dot com
2021-03-29 17:40 ` [Bug c++/99806] [10/11 Regression] ICE: in tsubst_copy, at cp/pt.c:17247 mpolacek at gcc dot gnu.org
2021-03-29 17:40 ` mpolacek at gcc dot gnu.org
2021-04-07 21:20 ` mpolacek at gcc dot gnu.org
2021-04-08  1:13 ` mpolacek at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-08 17:44 ` mpolacek at gcc dot gnu.org
2021-04-08 19:14 ` mpolacek at gcc dot gnu.org
2021-04-09 14:29 ` cvs-commit at gcc dot gnu.org
2021-04-09 14:32 ` [Bug c++/99806] [10 " mpolacek at gcc dot gnu.org
2021-04-09 14:51 ` ppalka at gcc dot gnu.org
2021-04-09 22:47 ` cvs-commit at gcc dot gnu.org [this message]
2021-04-09 22:48 ` mpolacek 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-99806-4-DYQsvKKWTl@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).