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

--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #6)
> (In reply to Petr Sumbera from comment #5)
> > Is there any workaround for this issue?
> 
> I guess replacing that
> [aSpecialValueMappers...](const SpecialConstant<S>& aSpecialValue) {
> with
> [=](const SpecialConstant<S>& aSpecialValue) {

And just removing the ellipsis from the lambda capture in

  [aSpecialValueMappers...](const SpecialConstant<S>& aSpecialValue) {

should be a valid workaround too, I think.


In comment #2, the lambda capture can basically be written in three ways:

1. foo([=] { return x; }, ...);
2. foo([x...] { return x; }, ...);
3. foo([...y{x}] { return y; }, ...);

GCC accepts 1 and ICEs on 2 & 3.
Clang accepts 1 & 2 and rejects 3 with "unexpanded parameter pack 'y'".

Reply via email to