public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101921] New: G++ cannot find a template function with lambda as default template argument
@ 2021-08-15 11:30 fchelnokov at gmail dot com
  2021-08-15 11:35 ` [Bug c++/101921] G++ cannot find a template function with lambda as default template argument inside a template pinskia at gcc dot gnu.org
  2021-12-20  6:12 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: fchelnokov at gmail dot com @ 2021-08-15 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101921
           Summary: G++ cannot find a template function with lambda as
                    default template argument
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

Compilation of this valid code:
```
template<class T = decltype([]{})> void bar() {}
void foo(auto) { bar(); }
```

results in error:
```
error: no matching function for call to 'bar()'
    2 | void foo(auto) { bar(); }
      |                  ~~~^~
note: candidate: 'template<class T> void bar()'
    1 | template<class T = decltype([]{})> void bar() {}
      |                                         ^~~
note:   template argument deduction/substitution failed:
```

Other compilers accept it: https://gcc.godbolt.org/z/9GsPo8Pnb

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

* [Bug c++/101921] G++ cannot find a template function with lambda as default template argument inside a template
  2021-08-15 11:30 [Bug c++/101921] New: G++ cannot find a template function with lambda as default template argument fchelnokov at gmail dot com
@ 2021-08-15 11:35 ` pinskia at gcc dot gnu.org
  2021-12-20  6:12 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-15 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-08-15
            Summary|G++ cannot find a template  |G++ cannot find a template
                   |function with lambda as     |function with lambda as
                   |default template argument   |default template argument
                   |                            |inside a template
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |rejects-valid

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
if foo was not a template function, then bar would work.

Confirmed.

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

* [Bug c++/101921] G++ cannot find a template function with lambda as default template argument inside a template
  2021-08-15 11:30 [Bug c++/101921] New: G++ cannot find a template function with lambda as default template argument fchelnokov at gmail dot com
  2021-08-15 11:35 ` [Bug c++/101921] G++ cannot find a template function with lambda as default template argument inside a template pinskia at gcc dot gnu.org
@ 2021-12-20  6:12 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-20  6:12 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 97610.

*** This bug has been marked as a duplicate of bug 97610 ***

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

end of thread, other threads:[~2021-12-20  6:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 11:30 [Bug c++/101921] New: G++ cannot find a template function with lambda as default template argument fchelnokov at gmail dot com
2021-08-15 11:35 ` [Bug c++/101921] G++ cannot find a template function with lambda as default template argument inside a template pinskia at gcc dot gnu.org
2021-12-20  6:12 ` 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).