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++/110580] [14 Regression] gcc fails to typecheck nix-2.16.1 source: error: invalid initialization of reference of type
Date: Tue, 11 Jul 2023 14:06:24 +0000	[thread overview]
Message-ID: <bug-110580-4-vVl3ZFi3Jg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110580-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from CVS 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:b76d71564925abcabe6f5ad61d904b23c682cdfb

commit r14-2433-gb76d71564925abcabe6f5ad61d904b23c682cdfb
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Jul 11 10:05:19 2023 -0400

    c++: coercing variable template from current inst [PR110580]

    Here during ahead of time coercion of the variable template-id v1<int>,
    since we pass only the innermost arguments to coerce_template_parms (and
    outer arguments are still dependent at this point), substitution of the
    default template argument V=U just lowers U from level 2 to level 1 rather
    than replacing it with int as expected.  Thus after coercion we incorrectly
    end up with (effectively) v1<int, T> instead of v1<int, int>.

    Coercion of a class/alias template-id on the other hand always passes
    all levels arguments, which avoids this issue.  So this patch makes us
    do the same for variable template-ids.

            PR c++/110580

    gcc/cp/ChangeLog:

            * pt.cc (lookup_template_variable): Pass all levels of arguments
            to coerce_template_parms, and use the parameters from the most
            general template.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1y/var-templ83.C: New test.

  parent reply	other threads:[~2023-07-11 14:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 21:46 [Bug c++/110580] New: " slyfox at gcc dot gnu.org
2023-07-07  6:53 ` [Bug c++/110580] " rguenth at gcc dot gnu.org
2023-07-09  7:02 ` pinskia at gcc dot gnu.org
2023-07-09 15:56 ` pinskia at gcc dot gnu.org
2023-07-09 18:26 ` pinskia at gcc dot gnu.org
2023-07-09 18:37 ` pinskia at gcc dot gnu.org
2023-07-10  5:47 ` pinskia at gcc dot gnu.org
2023-07-10  5:53 ` pinskia at gcc dot gnu.org
2023-07-10 18:24 ` ppalka at gcc dot gnu.org
2023-07-11 14:06 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-11 14:06 ` ppalka at gcc dot gnu.org
2023-07-11 19:02 ` slyfox 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-110580-4-vVl3ZFi3Jg@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).