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

--- Comment #6 from Max Enrico Winkler <mwinkler at blizzard dot com> ---
Also ran into another case where GCC doesn't consider explicit copy
constructors.
Should be valid according to
https://eel.is/c++draft/expr.prim.lambda.capture#15.

https://godbolt.org/z/74Ghqvse9

```
struct Foo
{
    Foo() = default;

    explicit Foo(const Foo&);
};

int main()
{
    Foo f;

    auto l = [c(f)] () {};
    l();
}
```

A workaround here is trivial atleast
```
auto l = [c = Foo(f)] () {};
```

Reply via email to