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++/107461] [12 Regression] ambiguity error for friend with templated constexpr argument
Date: Fri, 03 Feb 2023 15:07:20 +0000	[thread overview]
Message-ID: <bug-107461-4-YiLtJfRR4O@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107461-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:534aea1ca7e7538dc6af3eac3cd2ec6c7343fdee

commit r12-9103-g534aea1ca7e7538dc6af3eac3cd2ec6c7343fdee
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Feb 3 09:41:10 2023 -0500

    c++: unexpected ADDR_EXPR after overload set pruning [PR107461]

    Here the ahead-of-time overload set pruning in finish_call_expr is
    unintentionally returning a CALL_EXPR whose (pruned) callee is wrapped
    in an ADDR_EXPR, despite the original callee not being wrapped in an
    ADDR_EXPR.  This ends up causing a bogus declaration mismatch error in
    the below testcase because the call to min in #1 gets expressed as a
    CALL_EXPR of ADDR_EXPR of FUNCTION_DECL, whereas the level-lowered call
    to min in #2 gets expressed instead as a CALL_EXPR of FUNCTION_DECL.

    This patch fixes this by stripping the spurious ADDR_EXPR appropriately.
    Thus the first call to min now also gets expressed as a CALL_EXPR of
    FUNCTION_DECL, matching the behavior before r12-6075-g2decd2cabe5a4f.

            PR c++/107461

    gcc/cp/ChangeLog:

            * semantics.cc (finish_call_expr): Strip ADDR_EXPR from
            the selected callee during overload set pruning.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/call9.C: New test.

    (cherry picked from commit 59e0376f607805ef9b67fd7b0a4a3084ab3571a5)

  parent reply	other threads:[~2023-02-03 15:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30  8:17 [Bug c++/107461] New: GCC rejects program with ambiguity error jlame646 at gmail dot com
2022-10-30 19:13 ` [Bug c++/107461] " pinskia at gcc dot gnu.org
2022-11-08 14:19 ` [Bug c++/107461] [12/13 Regression] ambiguity error for friend with templated constexpr argument ppalka at gcc dot gnu.org
2023-01-13 11:37 ` rguenth at gcc dot gnu.org
2023-02-03 14:41 ` cvs-commit at gcc dot gnu.org
2023-02-03 15:07 ` cvs-commit at gcc dot gnu.org [this message]
2023-02-03 15:08 ` [Bug c++/107461] [12 " ppalka at gcc dot gnu.org
2023-02-04  7:26 ` raj.khem at gmail dot com
2023-02-04 10:37 ` jakub at gcc dot gnu.org
2023-02-04 10:39 ` jakub at gcc dot gnu.org
2023-02-04 10:39 ` [Bug c++/107461] [12/13 " jakub at gcc dot gnu.org
2023-02-04 17:02 ` ppalka at gcc dot gnu.org
2023-02-04 17:04 ` ppalka at gcc dot gnu.org
2023-02-04 17:14 ` jakub at gcc dot gnu.org
2023-02-06  2:35 ` cvs-commit at gcc dot gnu.org
2023-02-06  3:01 ` ppalka at gcc dot gnu.org
2023-02-06 16:33 ` [Bug c++/107461] [12 " cvs-commit at gcc dot gnu.org
2023-02-06 16:36 ` ppalka at gcc dot gnu.org
2023-03-03 14:12 ` ppalka 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-107461-4-YiLtJfRR4O@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).