public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66374] New: template function accessing a temporary through a lambda
@ 2015-06-02  5:36 sebastien.alaiwan at gmail dot com
  2015-06-02  8:55 ` [Bug c++/66374] [5/6 Regression] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sebastien.alaiwan at gmail dot com @ 2015-06-02  5:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66374

            Bug ID: 66374
           Summary: template function accessing a temporary through a
                    lambda
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebastien.alaiwan at gmail dot com
  Target Milestone: ---

The following C++ snippet used to compile, but doesn't anymore with current gcc
trunk.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-03  5:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02  5:36 [Bug c++/66374] New: template function accessing a temporary through a lambda sebastien.alaiwan at gmail dot com
2015-06-02  8:55 ` [Bug c++/66374] [5/6 Regression] " redi at gcc dot gnu.org
2015-06-02  9:38 ` miyuki at gcc dot gnu.org
2015-06-03  5:07 ` sebastien.alaiwan at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).