public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59991] New: Recursive lambda capture in C++1y constexpr function template causes internal compiler error
@ 2014-01-29 21:17 pkeir at outlook dot com
  2014-01-29 21:19 ` [Bug c++/59991] " pkeir at outlook dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pkeir at outlook dot com @ 2014-01-29 21:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59991

            Bug ID: 59991
           Summary: Recursive lambda capture in C++1y constexpr function
                    template causes internal compiler error
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pkeir at outlook dot com

Created attachment 31987
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31987&action=edit
The test case which produces the internal compiler error

The code below uses the C++1y feature of allowing declarations in constexpr
functions, but r should not be included in the lambda's capture list. There is
also an issue with excessive recursive template instantiation. In any case, the
code produces an internal compiler error starting with:

internal compiler error: in tsubst, at cp/pt.c:11350
   auto f = [r,x]() { return r(x); };

The full output and test case is attached. This was run under Ubuntu 13.10.

// $ g++ --version
// g++ (GCC) 4.9.0 20131201 (experimental)

template <typename T>
constexpr int r(T x) {
  auto f = [r,x]() { return r(x); };
  return 0;
}

int main(int argc, char *argv[])
{
  r(0);
  return 0;
}


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

end of thread, other threads:[~2015-06-23  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-29 21:17 [Bug c++/59991] New: Recursive lambda capture in C++1y constexpr function template causes internal compiler error pkeir at outlook dot com
2014-01-29 21:19 ` [Bug c++/59991] " pkeir at outlook dot com
2015-03-16 15:03 ` mpolacek at gcc dot gnu.org
2015-06-23  8:47 ` rguenth at gcc dot gnu.org

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).