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++/98899] [10/11 Regression] ICE in tsubst_copy, at cp/pt.c:16198 since r10-1280-g78f7607db4c53f8c
Date: Wed, 03 Feb 2021 15:17:43 +0000	[thread overview]
Message-ID: <bug-98899-4-MrVYGHvXnZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98899-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:25fdd0d6df44044a8b505e6fcd07270e2e279b06

commit r11-7065-g25fdd0d6df44044a8b505e6fcd07270e2e279b06
Author: Marek Polacek <polacek@redhat.com>
Date:   Mon Feb 1 23:30:05 2021 -0500

    c++: ICE with late parsing of noexcept in nested class [PR98899]

    Here we crash with a noexcept-specifier in a nested template class,
    because my handling of such deferred-parse noexcept-specifiers was
    gronked when we need to instantiate a DEFERRED_PARSE before it was
    actually parsed at the end of the outermost class.

    In

      struct S {
        template<class> struct B {
          B() noexcept(noexcept(x));
          int x;
        };
        struct A : B<int> {
          A() : B() {}
        };
      };

    we call complete_type for B<int> which triggers tsubsting S::B<int>::B()
    whose noexcept-specifier still contains a DEFERRED_PARSE.  The trick is
    to stash such noexcept-specifiers into DEFPARSE_INSTANTIATIONS so that
    we can replace it later when we've finally parsed all deferred
    noexcept-specifiers.

    In passing, fix missing usage of UNPARSED_NOEXCEPT_SPEC_P.

    gcc/cp/ChangeLog:

            PR c++/98899
            * parser.c (cp_parser_class_specifier_1): Use any possible
            DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN.
            (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS.
            * pt.c (tsubst_exception_specification): Stash new_specs into
            DEFPARSE_INSTANTIATIONS.
            * tree.c (fixup_deferred_exception_variants): Use
            UNPARSED_NOEXCEPT_SPEC_P.

    gcc/testsuite/ChangeLog:

            PR c++/98899
            * g++.dg/cpp0x/noexcept65.C: New test.

  parent reply	other threads:[~2021-02-03 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31  6:17 [Bug c++/98899] New: ICE: Illegal instruction: 4 "error: could not convert '<unparsed>' from ''<invalid tree code>'" on macOS akim.demaille at gmail dot com
2021-01-31  6:20 ` [Bug c++/98899] " akim.demaille at gmail dot com
2021-01-31  6:21 ` akim.demaille at gmail dot com
2021-02-01  8:53 ` [Bug c++/98899] [10/11 Regression] ICE in tsubst_copy, at cp/pt.c:16198 since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
2021-02-01 13:15 ` ppalka at gcc dot gnu.org
2021-02-01 13:28 ` mpolacek at gcc dot gnu.org
2021-02-03 15:17 ` cvs-commit at gcc dot gnu.org [this message]
2021-02-03 15:22 ` [Bug c++/98899] [10 " mpolacek at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-04-09 22:57 ` 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-98899-4-MrVYGHvXnZ@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).