http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50276
--- Comment #5 from Joel Yliluoma <bisqwit at iki dot fi> 2012-01-03 23:16:07
UTC ---
It also accepts this code without complaints, which is another error:
template<int i>
bool test()
{
if (bool value = this_identifier_has_not_been_declared( []() {} ))
return value;
__builtin_abort();
return false;
}
int main()
{
test<0>();
}
The wrong-code problem occurs also with this code:
template<int i>
bool test()
{
if (bool value = []() { return 1; } )
return value;
__builtin_abort();
return false;
}
int main()
{
test<0>();
}