https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122144
Bug ID: 122144
Summary: Pack expansion with a lambda as a pattern mistakenly
leads to CE
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ddvamp007 at gmail dot com
Target Milestone: ---
On godbolt, x86-64 gcc trunk (16.0)
#include <tuple>
template <typename ...Ts>
void foo(Ts ...ts) {
[ts...]() {
// return std::tuple([u = ts](){}...); // OK
return std::tuple([ts](){}...); // CE: parameter packs not expanded
};
}
int main() {
foo(0);
return 0;
}
I believe that this code is valid by the standard. Correct me if not