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++/96604] rejects-valid on befriending specialization of conversion function template
Date: Sat, 09 Apr 2022 01:51:03 +0000	[thread overview]
Message-ID: <bug-96604-4-UHAp8Qcw1F@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96604-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:58586721c79f77224b8571a5dba732620d5546ab

commit r12-8065-g58586721c79f77224b8571a5dba732620d5546ab
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Apr 6 23:46:53 2022 -0400

    c++: friend implicit template instantiation [PR91618]

    This rule that for a friend with a qualified name we try to find a
    matching template was already in C++98, but it seems we never implemented
    it, and nobody reported it until 2019.

    This patch sets DECL_IMPLICIT_INSTANTIATION to signal to
    check_explicit_specialization that we want to find a template, like
    grokfndecl already did for explicit template args.  check_classfn also
needs
    to call it, as check_classfn is called after the call to
    check_explicit_specialization in grokfndecl, whereas the call to
    set_decl_namespace comes sooner.  This inconsistency is inelegant, but
safer
    at this point in the release cycle; I'll unify them in stage 1.

            PR c++/91618
            PR c++/96604

    gcc/cp/ChangeLog:

            * name-lookup.cc (set_decl_namespace): Set
            DECL_IMPLICIT_INSTANTIATION if no non-template match.
            * pt.cc (check_explicit_specialization): Check it.
            * decl2.cc (check_classfn): Call it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/friend7.C: Remove xfail.
            * g++.dg/template/friend72.C: New test.
            * g++.dg/template/friend72a.C: New test.
            * g++.dg/template/friend73.C: New test.

  parent reply	other threads:[~2022-04-09  1:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 17:13 [Bug c++/96604] New: " richard-gccbugzilla at metafoo dot co.uk
2020-08-13 17:15 ` [Bug c++/96604] " mpolacek at gcc dot gnu.org
2022-04-07 21:10 ` jason at gcc dot gnu.org
2022-04-09  1:51 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-29 21:25 ` 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-96604-4-UHAp8Qcw1F@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).