public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50431] New: lambda bug for array size def
@ 2011-09-16 11:41 zhudiqi at 163 dot com
  2011-09-16 11:51 ` [Bug c++/50431] " zhudiqi at 163 dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhudiqi at 163 dot com @ 2011-09-16 11:41 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50431
           Summary: lambda bug for array size def
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zhudiqi@163.com


This code is OK,
OK:
  constexpr auto sz = []()->long { return 100L; };
  int arr1[sz()];

  int arr2[[]()->long { return 100L; }()];

But these code will failed for g++ compiler 4.6.1.

BUG1:
  auto sz = []()->constexpr long { return 100L; };
  int arr[[]()->long { return 100L; }];

BUG2:
  //feature.cpp:51:38: internal compiler error: Segmentation fault
  int arr[[]()->long { return 100L; }];


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

end of thread, other threads:[~2011-11-13 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 11:41 [Bug c++/50431] New: lambda bug for array size def zhudiqi at 163 dot com
2011-09-16 11:51 ` [Bug c++/50431] " zhudiqi at 163 dot com
2011-09-16 12:05 ` zhudiqi at 163 dot com
2011-09-16 12:45 ` [Bug c++/50431] [C++0x] bug in def array size with a lambda redi at gcc dot gnu.org
2011-09-16 14:01 ` redi at gcc dot gnu.org
2011-11-05 21:33 ` paolo.carlini at oracle dot com
2011-11-13 13:09 ` zhudiqi at 163 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).