g++ regression: template function accessing a temporary through a lambda

ace17@free.fr ace17@free.fr
Tue Jun 2 05:28:00 GMT 2015


Hi folks,
the following C++ snippet used to compile, but doesn't anymore with current gcc trunk.
Hope this helps!

Thanks,
Sebastien Alaiwan

-----------------
// simple.cpp
int getValueOfSix()
{
  return 6;
}

template<int A>
void f()
{
  auto const c = getValueOfSix();

  auto lambda = [&] ()
  {
    auto a = c;
    auto b = c;
  };
}

void g()
{
  f<0>();
}



More information about the Gcc mailing list