https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97358
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #13) > (In reply to Jakub Jelinek from comment #11) > > (In reply to Jason Merrill from comment #10) > > > This doesn't look valid to me. In > > > > > > [x...] { x; }... > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97358#c3 is what they actually > > have (not sure if it changes anything on the validness) and I have full > > preprocessed source, so can supply further details that would be needed. > > That doesn't change anything; they should remove the ... from the capture to > make the testcase valid. Please check that the patch I just checked in > replaces the ICE with an error, thanks. Ok, confirmed (with a backport to 10 because that in a cross to powerpc64le is where I was testing it before), the unmodified original *.ii now errors out: cchFugMG.ii: In lambda function: cchFugMG.ii:73385:65: error: parameter packs not expanded with ‘...’: 73385 | return ErrorResult{aSpecialValueMappers(aSpecialValue)}; | ^ cchFugMG.ii:73385:65: note: ‘aSpecialValueMappers’ and compiles fine with the ErrorResult ExtractErrorResult(SpecialValueMappers... aSpecialValueMappers) { return mVariant.match( [](ErrorResult& aException) { return std::move(aException); }, - [aSpecialValueMappers...](const SpecialConstant<S>& aSpecialValue) { + [aSpecialValueMappers](const SpecialConstant<S>& aSpecialValue) { return ErrorResult{aSpecialValueMappers(aSpecialValue)}; }...); } change (in that case both with unmodified as well as modified gcc).