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++/101460] Useless cascade of overload resolution errors for invalid expression
Date: Mon, 30 Aug 2021 21:23:39 +0000	[thread overview]
Message-ID: <bug-101460-4-3WJAyAVETd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101460-4@http.gcc.gnu.org/bugzilla/>

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

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

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

commit r12-3234-ga8de832470f78a40a0e2c8de866a471bf74bf0ab
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Aug 30 09:44:28 2021 -0400

    c++: fold function template args sooner [PR101460]

    As discussed in the PR, we were giving a lot of unnecessary errors for this
    testcase because we didn't try to do constant evaluation until
    convert_nontype_argument, which happens for each of the candidates.  But
    when looking at a template-id as the function operand of a call, we can try
    to fold arguments before we get into overload resolution.

            PR c++/101460

    gcc/cp/ChangeLog:

            * cp-tree.h (cxx_constant_value_sfinae): Declare.
            * constexpr.c (cxx_constant_value_sfinae): New.
            * pt.c (fold_targs_r, maybe_fold_fn_template_args): New.
            (tsubst_copy_and_build) [CALL_EXPR]: Call
            maybe_fold_fn_template_args.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/explicit-args6.C: New test.

  parent reply	other threads:[~2021-08-30 21:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 11:11 [Bug c++/101460] New: " redi at gcc dot gnu.org
2021-07-15 11:58 ` [Bug c++/101460] " redi at gcc dot gnu.org
2021-07-15 12:04 ` redi at gcc dot gnu.org
2021-07-15 15:26 ` cvs-commit at gcc dot gnu.org
2021-07-19 12:38 ` cvs-commit at gcc dot gnu.org
2021-08-30 13:45 ` jason at gcc dot gnu.org
2021-08-30 21:23 ` cvs-commit at gcc dot gnu.org [this message]
2021-08-30 21:29 ` 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-101460-4-3WJAyAVETd@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).