public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65339] New: [5 Regression] C++ ICE with lambda and no capture list
Date: Fri, 06 Mar 2015 19:33:00 -0000	[thread overview]
Message-ID: <bug-65339-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2015-03-06 19:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 19:33 aldyh at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65339-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).