public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list
@ 2015-03-06 19:33 aldyh at gcc dot gnu.org
  2015-03-07 12:43 ` [Bug c++/65339] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2015-03-06 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65339
           Summary: [5 Regression] C++ ICE with lambda and no capture list
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aldyh at gcc dot gnu.org

./cc1plus a.ii -fdump-tree-all -quiet -I/tmp -std=c++11
a.ii: In static member function ‘static Object
Object::Method()::<lambda()>::_FUN()’:
a.ii:22:3: internal compiler error: Segmentation fault
   });
   ^
0xf462c2 crash_signal
        /source/gcc/gcc/toplev.c:383
0x697de7 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /source/gcc/gcc/tree.h:2959
0x91da6a lambda_expr_this_capture(tree_node*, bool)
        /source/gcc/gcc/cp/lambda.c:752
0x91dd46 maybe_resolve_dummy(tree_node*, bool)
        /source/gcc/gcc/cp/lambda.c:789
0x6b4f06 build_new_method_call_1
        /source/gcc/gcc/cp/call.c:8023
0x6b6280 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        /source/gcc/gcc/cp/call.c:8271
0x6b4216 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        /source/gcc/gcc/cp/call.c:7815
0x6ac5bf build_temp
...
...

$ cat a.ii
class FuncWrapper {
public:
  template <typename Func> void callfunc(Func f)
  {
     f();
  }
};

class Object {
  int field;
public:
  void Method();
  Object() { field = 555; }
};

void Object::Method ()
{
  FuncWrapper wrap;
  wrap.callfunc([]()
        {
          return Object();
        });
}

Notice the empty cature list.  We are hitting lambda_expr_this_capture() with
current_class_ref == NULL:

      /* To make sure that current_class_ref is for the lambda.  */
      gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (current_class_ref))
          == LAMBDA_EXPR_CLOSURE (lambda));

Perhaps we can add "!current_class_ref ||"
>From gcc-bugs-return-479609-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 06 19:34:56 2015
Return-Path: <gcc-bugs-return-479609-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 112492 invoked by alias); 6 Mar 2015 19:34:56 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 112442 invoked by uid 48); 6 Mar 2015 19:34:53 -0000
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65339] [5 Regression] C++ ICE with lambda and no capture list
Date: Fri, 06 Mar 2015 19:34:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: aldyh at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: aldyh at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: priority cc assigned_to
Message-ID: <bug-65339-4-w3JZHkEmVS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65339-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65339-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00753.txt.bz2
Content-length: 444

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide339

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |aldyh at gcc dot gnu.org


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

* [Bug c++/65339] [5 Regression] C++ ICE with lambda and no capture list
  2015-03-06 19:33 [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list aldyh at gcc dot gnu.org
@ 2015-03-07 12:43 ` jakub at gcc dot gnu.org
  2015-03-09 20:00 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-07 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-07
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r210292.


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

* [Bug c++/65339] [5 Regression] C++ ICE with lambda and no capture list
  2015-03-06 19:33 [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list aldyh at gcc dot gnu.org
  2015-03-07 12:43 ` [Bug c++/65339] " jakub at gcc dot gnu.org
@ 2015-03-09 20:00 ` jason at gcc dot gnu.org
  2015-03-09 20:20 ` jakub at gcc dot gnu.org
  2015-03-09 20:36 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-09 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Mar  9 19:59:54 2015
New Revision: 221285

URL: https://gcc.gnu.org/viewcvs?rev=221285&root=gcc&view=rev
Log:
    PR c++/65339
    * call.c: Don't call maybe_resolve_dummy when calling a constructor.

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


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

* [Bug c++/65339] [5 Regression] C++ ICE with lambda and no capture list
  2015-03-06 19:33 [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list aldyh at gcc dot gnu.org
  2015-03-07 12:43 ` [Bug c++/65339] " jakub at gcc dot gnu.org
  2015-03-09 20:00 ` jason at gcc dot gnu.org
@ 2015-03-09 20:20 ` jakub at gcc dot gnu.org
  2015-03-09 20:36 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-09 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

* [Bug c++/65339] [5 Regression] C++ ICE with lambda and no capture list
  2015-03-06 19:33 [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list aldyh at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-09 20:20 ` jakub at gcc dot gnu.org
@ 2015-03-09 20:36 ` aldyh at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: aldyh at gcc dot gnu.org @ 2015-03-09 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doko at gcc dot gnu.org

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
*** Bug 65284 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2015-03-09 20:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-06 19:33 [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list aldyh at gcc dot gnu.org
2015-03-07 12:43 ` [Bug c++/65339] " jakub at gcc dot gnu.org
2015-03-09 20:00 ` jason at gcc dot gnu.org
2015-03-09 20:20 ` jakub at gcc dot gnu.org
2015-03-09 20:36 ` aldyh 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).