Skip to content

CWG3218 [temp.variadic] Expanding packs created within a pack expansion #976

Description

@Halalaluyafail3

Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron

Reference (section label): [temp.variadic]

Issue description:

Consider the following:

#include<tuple>
void bar(auto...){}
void foo(auto x){
    bar([&]{auto[...y]=x;return y;}()...);
}
int main(){
    foo(std::tuple());
}

Clang rejects this, GCC is OK with it except for the actual instantiation of foo which causes an ICE. A second example is with fold expressions:

#include<tuple>
void baz(auto z){
    (...,[&]{auto[...w]=z;w;}());
}
int main(){
    baz(std::tuple());
}

There does not seem to be anything that forbids these examples, even though I do not think it was intended to allow them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions