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

David Stone <davidfromonline at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davidfromonline at gmail dot 
com

--- Comment #2 from David Stone <davidfromonline at gmail dot com> ---
I believe clang is correct here. Here is another version that is also rejected
by gcc and msvc, but accepted by clang:

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

template<typename... Ts>
void f(Ts... ts) {
        [](any<Ts> auto..., auto) {}(ts..., 2);
}

void g() {
        f(1);
}
```

Which looks basically the same. All three compilers accept if line 10 is
changed from `f(1);` to to `f();`. Further, all three compilers also accept
this minor modification:

```
template<typename... Ts>
void f(Ts... ts) {
        [](Ts..., auto) {}(ts..., 2);
}

void g() {
        f(1);
}
```

Further supporting the view that it's a bug in msvc as well, look at the error
message it gives: "expects 2 arguments - 2 provided". Clearly something fishy
is going on in those compiler internals.

Reply via email to