public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106211] Rejects valid with function template with non-deduced parameters from deduced parameters of another function template
Date: Wed, 06 Jul 2022 22:34:24 +0000	[thread overview]
Message-ID: <bug-106211-4-THUyAXKkCJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106211-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The question comes about variadic templates and deduction of auto.

>Further, all three compilers also accept this minor modification:
This one does need any deduction though so it is not even related.

So let's take the slightly reduced testcase:

template<typename, typename>
concept any = true;

auto t = []<typename... Ts>(Ts...) {
    return [](any<Ts> auto... b, auto c) {return c;};
}(1);
auto t1 = t(2, 3);

We have now:
Ts being <int>
so we get:

                return [](any<int> auto, auto) {};

Which is invalid as any<int> is invalid.
Maybe I misunderstand how this works though.

If we remove the any<Ts> then we get the same failure for clang as GCC:
<source>:7:11: error: no matching function for call to object of type '(lambda
at <source>:5:12)'
auto t1 = t(2, 3);
          ^
<source>:5:12: note: candidate function [with b:auto = <>, c:auto = int] not
viable: requires single argument 'c', but 2 arguments were provided
    return [](auto... b, auto c) {return c;};
           ^

Which is to say the problem is the way variadic templates with auto is being
handled. I suspect the concept is being handled incorrectly for clang.

  parent reply	other threads:[~2022-07-06 22:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  3:31 [Bug c++/106211] New: " davidfromonline at gmail dot com
2022-07-06 20:59 ` [Bug c++/106211] " pinskia at gcc dot gnu.org
2022-07-06 22:22 ` davidfromonline at gmail dot com
2022-07-06 22:34 ` pinskia at gcc dot gnu.org [this message]
2022-07-06 22:39 ` davidfromonline at gmail dot com
2024-04-11 23:48 ` pinskia 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-106211-4-THUyAXKkCJ@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).