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

            Bug ID: 105106
           Summary: Dependent invocation with defaulted NTTP lambda fails
           Product: gcc
           Version: 9.4.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/obfY3Mdba:
```C++
template <auto l = []{}>
auto foo() {
    return l;
}

template <class>
auto bar() {
    return foo();
}
```

The error message looks cut short:
```
<source>: In function 'auto bar()':
<source>:8:16: error: no matching function for call to 'foo()'
    8 |     return foo();
      |                ^
<source>:2:6: note: candidate: 'template<auto l> auto foo()'
    2 | auto foo() {
      |      ^~~
<source>:2:6: note:   template argument deduction/substitution failed:
```

Reply via email to