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++/110025] [C++23] ICE with default-argument for template-param with decltype and auto.
Date: Fri, 01 Mar 2024 17:51:52 +0000	[thread overview]
Message-ID: <bug-110025-4-tXZP1uY0rU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110025-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

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

commit r14-9260-ga6a1920b592b58c38137c5c891b3bbb02b084f38
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Mar 1 12:50:18 2024 -0500

    c++: auto(x) partial substitution [PR110025, PR114138]

    In r12-6773-g09845ad7569bac we gave CTAD placeholders a level of 0 and
    ensured we never replaced them via tsubst.  It turns out that autos
    representing an explicit cast need the same treatment and for the same
    reason: such autos appear in an expression context and so their level
    gets easily messed up after partial substitution, leading to premature
    replacement via an incidental tsubst instead of via do_auto_deduction.

    This patch fixes this by extending the r12-6773 approach to auto(x).

            PR c++/110025
            PR c++/114138

    gcc/cp/ChangeLog:

            * cp-tree.h (make_cast_auto): Declare.
            * parser.cc (cp_parser_functional_cast): If the type is an auto,
            replace it with a level-less one via make_cast_auto.
            * pt.cc (find_parameter_packs_r): Don't treat level-less auto
            as a type parameter pack.
            (tsubst) <case TEMPLATE_TYPE_PARM>: Generalize CTAD placeholder
            auto handling to all level-less autos.
            (make_cast_auto): Define.
            (do_auto_deduction): Handle replacement of a level-less auto.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp23/auto-fncast16.C: New test.
            * g++.dg/cpp23/auto-fncast17.C: New test.
            * g++.dg/cpp23/auto-fncast18.C: New test.

    Reviewed-by: Jason Merrill <jason@redhat.com>

      parent reply	other threads:[~2024-03-01 17:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 15:09 [Bug c++/110025] New: " jehelset at gmail dot com
2023-05-29 18:09 ` [Bug c++/110025] " jehelset at gmail dot com
2023-05-30  3:56 ` pinskia at gcc dot gnu.org
2023-05-30  3:56 ` pinskia at gcc dot gnu.org
2023-05-30  3:59 ` pinskia at gcc dot gnu.org
2023-05-30  4:13 ` [Bug c++/110025] [C++23] " pinskia at gcc dot gnu.org
2023-05-30  4:13 ` pinskia at gcc dot gnu.org
2023-05-30  9:20 ` jehelset at gmail dot com
2024-03-01 17:51 ` cvs-commit at gcc dot gnu.org [this message]

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-110025-4-tXZP1uY0rU@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).