This is the mail archive of the gcc@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]

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


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


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