Consider the following code snippet:
template <int... Is>
void foo()
{
([i = Is]{}(), ...);
}
clang++
(trunk) successfully compiles the code with-std=c++17
g++
(trunk) fails to compile with the following error:<source>: In function 'void foo()': <source>:4:11: error: parameter packs not expanded with '...': ([i = Is]{}(), ...); ^~ <source>:4:11: note: 'Is' <source>:4:16: error: operand of fold expression has no unexpanded parameter packs ([i = Is]{}(), ...); ~~~~~~~~~~^~
Is this a g++
bug, or does the Standard prevent expansion of a parameter pack as part of a lambda-introducer?