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++/105852] [11/12/13 Regression] ice in instantiate_decl
Date: Wed, 08 Jun 2022 21:31:13 +0000	[thread overview]
Message-ID: <bug-105852-4-IdEP5onZOt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105852-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:e057d454db4dcf48c22f75e57599f797d8e55baf

commit r12-8467-ge057d454db4dcf48c22f75e57599f797d8e55baf
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jun 6 21:49:06 2022 -0400

    c++: redeclared hidden friend take 2 [PR105852]

    My previous patch for 105761 avoided copying DECL_TEMPLATE_INFO from a
    friend to a later definition, but in this testcase we have first a
    non-friend declaration and then a definition, and we need to avoid copying
    in that case as well.  But we do still want to set new_template_info to
    avoid GC trouble.

    With this change, the modules dump correctly identifies ::foo as a
    non-template function in tpl-friend-2_a.C.

    Along the way I noticed that the duplicate_decls handling of
    DECL_UNIQUE_FRIEND_P was backwards for templates, where we don't clobber
    DECL_LANG_SPECIFIC (olddecl) with DECL_LANG_SPECIFIC (newdecl) like we do
    for non-templates.

            PR c++/105852
            PR c++/105761

    gcc/cp/ChangeLog:

            * decl.cc (duplicate_decls): Avoid copying template info
            from non-templated friend even if newdecl isn't a definition.
            Correct handling of DECL_UNIQUE_FRIEND_P on templates.
            * pt.cc (non_templated_friend_p): New.
            * cp-tree.h (non_templated_friend_p): Declare it.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/tpl-friend-2_a.C: Adjust expected dump.
            * g++.dg/template/friend74.C: New test.

  parent reply	other threads:[~2022-06-08 21:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05  4:49 [Bug c/105852] New: " dcb314 at hotmail dot com
2022-06-05  5:01 ` [Bug c++/105852] [13 Regression] " pinskia at gcc dot gnu.org
2022-06-05  7:02 ` dcb314 at hotmail dot com
2022-06-05 21:09 ` sam at gentoo dot org
2022-06-05 21:10 ` sam at gentoo dot org
2022-06-06 12:53 ` ppalka at gcc dot gnu.org
2022-06-06 13:03 ` [Bug c++/105852] [11/12/13 " ppalka at gcc dot gnu.org
2022-06-06 15:08 ` slyfox at gcc dot gnu.org
2022-06-06 22:39 ` jason at gcc dot gnu.org
2022-06-08 20:38 ` cvs-commit at gcc dot gnu.org
2022-06-08 20:39 ` cvs-commit at gcc dot gnu.org
2022-06-08 21:31 ` cvs-commit at gcc dot gnu.org [this message]
2022-06-08 21:31 ` cvs-commit at gcc dot gnu.org
2022-06-13 12:52 ` rguenth at gcc dot gnu.org
2023-05-09  3:47 ` cvs-commit at gcc dot gnu.org
2023-05-09  3:51 ` cvs-commit 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-105852-4-IdEP5onZOt@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).