This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50276] [C++0x] Wrong "used uninitialized in this function" warning


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>();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]