This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50276] [C++0x] Wrong "used uninitialized in this function" warning
- From: "bisqwit at iki dot fi" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jan 2012 23:16:07 +0000
- Subject: [Bug c++/50276] [C++0x] Wrong "used uninitialized in this function" warning
- Auto-submitted: auto-generated
- References: <bug-50276-4@http.gcc.gnu.org/bugzilla/>
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>();
}