[Bug c++/67247] ICE on std::forward args&& inside nested lambda function
tower120 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 25 17:33:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67247
tower120 <tower120 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |6.0
--- Comment #4 from tower120 <tower120 at gmail dot com> ---
Reduced case [Forwarding captured variadic arguments inside lambda] :
https://godbolt.org/g/D7lXEA
template<typename... T>
int g(T... t)
{
return 0;
}
template<class... Args>
void f(Args&&... args)
{
auto lm = [&](auto&&..._args) {
auto f = [&]{g(std::forward<decltype(_args)>(_args)...);};
//auto f = [&]{g(_args...);}; /* THIS ONE OK */
return f();
};
lm(args...);
}
int main()
{
f(2, 5, 7);
}
Error "_args was not declared" on 4.9.x
ICE on 5.x
Ok on 6.x
More information about the Gcc-bugs
mailing list