public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51227] New: [c++0x] ICE with invalid parameter in lambda expression
@ 2011-11-19 20:40 reichelt at gcc dot gnu.org
  2011-11-24 12:19 ` [Bug c++/51227] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-11-19 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51227
           Summary: [c++0x] ICE with invalid parameter in lambda
                    expression
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: reichelt@gcc.gnu.org


The following invalid code snippet triggers an ICE when compiled with
"-std=c++0x" since the introduction of lambda expressions (GCC 4.5.0):

====================================
template<int> int foo()
{
  [] (void i) { return 0; } (0);
}

void bar()
{
  foo<0>();
}
====================================

bug.cc: In function 'int foo()':
bug.cc:3:12: error: 'i' has incomplete type
bug.cc:3:13: error: invalid use of 'void'
bug.cc: In instantiation of 'struct foo() [with int <anonymous> =
0]::<lambda>':
bug.cc:3:3:   required from 'int foo() [with int <anonymous> = 0]'
bug.cc:8:10:   required from here
bug.cc:3:4: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]


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

* [Bug c++/51227] [c++0x] ICE with invalid parameter in lambda expression
  2011-11-19 20:40 [Bug c++/51227] New: [c++0x] ICE with invalid parameter in lambda expression reichelt at gcc dot gnu.org
@ 2011-11-24 12:19 ` paolo.carlini at oracle dot com
  2011-11-25  1:19 ` paolo at gcc dot gnu.org
  2011-11-25  1:25 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-24 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-24
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-24 11:50:46 UTC ---
In instantiate_class_template_1 we do:

  instantiate_decl (lambda_function (type), false, false);

but lambda_function can definitely return NULL_TREE and instantiate_decl cannot
cope with it.


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

* [Bug c++/51227] [c++0x] ICE with invalid parameter in lambda expression
  2011-11-19 20:40 [Bug c++/51227] New: [c++0x] ICE with invalid parameter in lambda expression reichelt at gcc dot gnu.org
  2011-11-24 12:19 ` [Bug c++/51227] " paolo.carlini at oracle dot com
@ 2011-11-25  1:19 ` paolo at gcc dot gnu.org
  2011-11-25  1:25 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-11-25  1:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-11-25 01:00:51 UTC ---
Author: paolo
Date: Fri Nov 25 01:00:44 2011
New Revision: 181707

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181707
Log:
/cp
2011-11-24  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51227
    * pt.c (instantiate_class_template_1): If lambda_function (type)
    is NULL_TREE do not instantiate_decl.

/testsuite
2011-11-24  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51227
    * g++.dg/cpp0x/lambda/lambda-ice5.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/51227] [c++0x] ICE with invalid parameter in lambda expression
  2011-11-19 20:40 [Bug c++/51227] New: [c++0x] ICE with invalid parameter in lambda expression reichelt at gcc dot gnu.org
  2011-11-24 12:19 ` [Bug c++/51227] " paolo.carlini at oracle dot com
  2011-11-25  1:19 ` paolo at gcc dot gnu.org
@ 2011-11-25  1:25 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-25  1:25 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com
   Target Milestone|---                         |4.7.0

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-25 01:02:23 UTC ---
Fixed for 4.7.0.


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

end of thread, other threads:[~2011-11-25  1:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-19 20:40 [Bug c++/51227] New: [c++0x] ICE with invalid parameter in lambda expression reichelt at gcc dot gnu.org
2011-11-24 12:19 ` [Bug c++/51227] " paolo.carlini at oracle dot com
2011-11-25  1:19 ` paolo at gcc dot gnu.org
2011-11-25  1:25 ` paolo.carlini at oracle 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).