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++/112594] Non-type template parameter created with converting constructor sometimes has original type
Date: Fri, 19 Jan 2024 18:35:16 +0000	[thread overview]
Message-ID: <bug-112594-4-9RwqCrvGAG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112594-4@http.gcc.gnu.org/bugzilla/>

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

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

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

commit r14-8291-gf1e5bf0d83ee4da81b6317c6d7f1278fe7eaa5a0
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jan 17 17:29:33 2024 -0500

    c++: alias template argument conversion [PR112632]

    We've had a problem with lost conversions to template parameter types for a
    while now; looking at this PR, it occurred to me that the problem is really
    with alias (and concept) templates, since we do substitution of dependent
    arguments into them in a way that we don't for other templates.  And fixing
    that specific problem is a lot simpler than adding IMPLICIT_CONV_EXPR
around
    all dependent template arguments the way I gave up on for 111357.

    The other part of the fix was changing tsubst_expr to actually call
    convert_nontype_argument instead of assuming it will eventually happen.

    I waffled about stripping the forced conversion when !force_conv
    vs. skipping them in iterative_hash_template_arg and
    template_args_equal (like we already do for some other conversions) and
    decided to go with the former, but that isn't a strong preference if it
    turns out to be somehow problematic.

            PR c++/112632
            PR c++/112594
            PR c++/111357
            PR c++/104594
            PR c++/67898

    gcc/cp/ChangeLog:

            * cp-tree.h (IMPLICIT_CONV_EXPR_FORCED): New.
            * pt.cc (expand_integer_pack): Remove 111357 workaround.
            (maybe_convert_nontype_argument): Add force parm.
            (convert_template_argument): Handle alias template args
            specially.
            (tsubst_expr): Don't ignore IMPLICIT_CONV_EXPR_NONTYPE_ARG.
            * error.cc (dump_expr) [CASE_CONVERT]: Handle null optype.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/alias-decl-nontype1.C: New test.
            * g++.dg/cpp2a/concepts-narrowing1.C: New test.
            * g++.dg/cpp2a/nontype-class63.C: New test.
            * g++.dg/cpp2a/nontype-class63a.C: New test.

  parent reply	other threads:[~2024-01-19 18:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17 17:36 [Bug c++/112594] New: " mital at mitalashok dot co.uk
2023-11-20  5:05 ` [Bug c++/112594] " pinskia at gcc dot gnu.org
2023-11-20  5:09 ` pinskia at gcc dot gnu.org
2024-01-19 18:35 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-19 18:37 ` jason 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-112594-4-9RwqCrvGAG@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).