public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106211] New: Rejects valid with function template with non-deduced parameters from deduced parameters of another function template
@ 2022-07-06  3:31 davidfromonline at gmail dot com
  2022-07-06 20:59 ` [Bug c++/106211] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: davidfromonline at gmail dot com @ 2022-07-06  3:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106211
           Summary: Rejects valid with function template with non-deduced
                    parameters from deduced parameters of another function
                    template
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: davidfromonline at gmail dot com
  Target Milestone: ---

The following valid translation unit

```
template<typename, typename>
concept any = true;

void f() {
        []<typename... Ts>(Ts...) {
                return [](any<Ts> auto..., auto) {};
        }(0)(0, 0);
}
```

is rejected by gcc with the error message:

```
<source>: In function 'void f()':
<source>:7:13: error: no match for call to '(f()::<lambda(Ts
...)>::<lambda(auto:1 ..., auto:2)>) (int, int)'
    5 |         []<typename... Ts>(Ts...) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 |                 return [](any<Ts> auto..., auto) {};
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    7 |         }(0)(0, 0);
      |         ~~~~^~~~~~
<source>:6:24: note: candidate: 'template<class ... auto:1, class auto:2> 
requires (... && any<auto:1, Ts>) f()::<lambda(Ts ...)>::<lambda(auto:1 ...,
auto:2)>'
    6 |                 return [](any<Ts> auto..., auto) {};
      |                        ^
<source>:6:24: note:   template argument deduction/substitution failed:
<source>:7:13: note:   candidate expects 1 argument, 2 provided
    5 |         []<typename... Ts>(Ts...) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    6 |                 return [](any<Ts> auto..., auto) {};
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    7 |         }(0)(0, 0);
      |         ~~~~^~~~~~
Compiler returned: 1
```

See it live: https://godbolt.org/z/c7zxWEbxM

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-11 23:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  3:31 [Bug c++/106211] New: Rejects valid with function template with non-deduced parameters from deduced parameters of another function template 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
2022-07-06 22:39 ` davidfromonline at gmail dot com
2024-04-11 23:48 ` pinskia at gcc dot gnu.org

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).