[Bug c++/103969] New: 'auto' parameter not permitted in this context
egor.pugin at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jan 10 19:55:34 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103969
Bug ID: 103969
Summary: 'auto' parameter not permitted in this context
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: egor.pugin at gmail dot com
Target Milestone: ---
template <auto = [](auto &&v) -> decltype(auto) { return v; }>
struct s {};
gives
Output of x86-64 gcc (trunk) (Compiler #2)
<source>:1:21: error: 'auto' parameter not permitted in this context
1 | template <auto = [](auto &&v) -> decltype(auto) { return v; }>
| ^~~~
<source>: In lambda function:
<source>:1:58: error: 'v' was not declared in this scope
1 | template <auto = [](auto &&v) -> decltype(auto) { return v; }>
| ^
clang, msvc work fine.
https://godbolt.org/z/4Mf5efeWY
More information about the Gcc-bugs
mailing list