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++/107437] nested generic lambdas fail requiring unneded captures
Date: Wed, 28 Jun 2023 19:44:06 +0000	[thread overview]
Message-ID: <bug-107437-4-TWPwj625UA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107437-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 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:4cf64d9cc2faf4001f037a50a350abd0f95f3e29

commit r14-2170-g4cf64d9cc2faf4001f037a50a350abd0f95f3e29
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Jun 28 15:43:33 2023 -0400

    c++: ahead of time variable template-id coercion [PR89442]

    This patch makes us coerce the arguments of a variable template-id ahead
    of time, as we do for class template-ids, which causes us to immediately
    diagnose template parm/arg kind mismatches and arity mismatches.

    Unfortunately this causes a regression in cpp1z/constexpr-if20.C: coercing
    the variable template-id m<ar, as> ahead of time means we strip it of
    typedefs, yielding m<typename C<i>::q, typename C<j>::q>, but in this
    stripped form we're directly using 'i' and so we expect to have captured
    it.  This is a variable template version of PR107437.

            PR c++/89442
            PR c++/107437

    gcc/cp/ChangeLog:

            * cp-tree.h (lookup_template_variable): Add complain parameter.
            * parser.cc (cp_parser_template_id): Pass tf_warning_or_error
            to lookup_template_variable.
            * pt.cc (lookup_template_variable): Add complain parameter.
            Coerce template arguments here ...
            (finish_template_variable): ... instead of here.
            (lookup_and_finish_template_variable): Check for error_mark_node
            result from lookup_template_variable.
            (tsubst_copy) <case TEMPLATE_ID_EXPR>: Pass complain to
            lookup_template_variable.
            (instantiate_template): Use build2 instead of
            lookup_template_variable to build a TEMPLATE_ID_EXPR
            for most_specialized_partial_spec.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp/pr64127.C: Expect "expected unqualified-id at end
            of input" error.
            * g++.dg/cpp0x/alias-decl-ttp1.C: Fix template parameter/argument
            kind mismatch for variable template has_P_match_V.
            * g++.dg/cpp1y/pr72759.C: Expect "template argument 1 is invalid"
            error.
            * g++.dg/cpp1z/constexpr-if20.C: XFAIL test due to bogus "'i' is
            not captured" error.
            * g++.dg/cpp1z/noexcept-type21.C: Fix arity of variable template d.
            * g++.dg/diagnostic/not-a-function-template-1.C: Add default
            template argument to variable template A so that A<> is valid.
            * g++.dg/parse/error56.C: Don't expect "ISO C++ forbids
            declaration with no type" error.
            * g++.dg/parse/template30.C: Don't expect "parse error in
            template argument list" error.
            * g++.dg/cpp1y/var-templ82.C: New test.

  parent reply	other threads:[~2023-06-28 19:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 15:20 [Bug c++/107437] New: " development at jordi dot vilar.cat
2022-10-27 15:31 ` [Bug c++/107437] " development at jordi dot vilar.cat
2022-11-01 23:05 ` pinskia at gcc dot gnu.org
2022-12-17 16:25 ` cvs-commit at gcc dot gnu.org
2022-12-17 16:34 ` ppalka at gcc dot gnu.org
2022-12-17 16:39 ` ppalka at gcc dot gnu.org
2023-06-28 19:44 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-04 15:03 ` 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-107437-4-TWPwj625UA@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).