From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26985 invoked by alias); 16 Oct 2013 22:54:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26961 invoked by uid 48); 16 Oct 2013 22:54:12 -0000 From: "ville.voutilainen at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58761] New: ICE with a lambda capturing this in a NSDMI Date: Wed, 16 Oct 2013 22:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ville.voutilainen at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg01161.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D58761 Bug ID: 58761 Summary: ICE with a lambda capturing this in a NSDMI Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com An unreduced (sorry) test snippet: #include #include #include template struct two_sided_list : std::forward_list { using std::forward_list::forward_list; typename std::forward_list::iterator push_back(T&& t) { end_ =3D this->insert_after(end_, std::forward(t)); } T& back() { return *end_; } private: typename std::forward_list::iterator end_ =3D [this](){this->end();}()= ; // #1 }; int main() { two_sided_list tsl{1,2,3}; std::cout << "back is " << tsl.back() << std::endl; tsl.push_back(4); std::cout << "back is " << tsl.back() << std::endl; } Goes kaboom: twosided_fwdlist_bug.cpp: In instantiation of =E2=80=98struct two_sided_list::=E2=80=99: twosided_fwdlist_bug.cpp:18:73: required from here twosided_fwdlist_bug.cpp:18:51: internal compiler error: in tsubst_copy, at cp/pt.c:12344 typename std::forward_list::iterator end_ =3D [this](){this->end();}(= ); ^ 0x5ab2e8 tsubst_copy ../../gcc/cp/pt.c:12344 0x585cab tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/cp/pt.c:14921 0x5873bb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/cp/pt.c:13987 0x585e15 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/cp/pt.c:14693 0x5c8ada instantiate_class_template_1 ../../gcc/cp/pt.c:9181 0x5c8ada instantiate_class_template(tree_node*) ../../gcc/cp/pt.c:9239 0x659f7b complete_type(tree_node*) ../../gcc/cp/typeck.c:132 0x586c75 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/cp/pt.c:15018 0x5876c7 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) ../../gcc/cp/pt.c:14415 0x68a0e6 perform_member_init ../../gcc/cp/init.c:538 0x68a0e6 emit_mem_initializers(tree_node*) ../../gcc/cp/init.c:1096 0x695172 do_build_copy_constructor ../../gcc/cp/method.c:622 0x695172 synthesize_method(tree_node*) ../../gcc/cp/method.c:794 0x605be9 mark_used(tree_node*, int) ../../gcc/cp/decl2.c:4778 0x534926 build_over_call ../../gcc/cp/call.c:7116 0x53071e build_new_method_call_1 ../../gcc/cp/call.c:7813 0x53071e build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int) ../../gcc/cp/call.c:7883 0x531692 build_special_member_call(tree_node*, tree_node*, vec**, tree_node*, int, int) ../../gcc/cp/call.c:7440 0x686417 expand_default_init ../../gcc/cp/init.c:1668 0x686417 expand_aggr_init_1 ../../gcc/cp/init.c:1769 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. If #1 is=20 typename std::forward_list::iterator end_ =3D this->end(); then it doesn't barf. That doesn't work, though, but that's not the compile= r's fault. If #1 is=20 typename std::forward_list::iterator end_ =3D [](typename std::forward_list::iterator s, typename std::forward_list::iterator e){auto r =3D s; while (++s !=3D e) r =3D s; return r;}(this->begin(), this= ->end()); it compiles and runs correctly. I'll try to create a bit more reduced test snippet soon. >>From gcc-bugs-return-432016-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 16 22:54:05 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 26329 invoked by alias); 16 Oct 2013 22:54:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 26298 invoked by uid 48); 16 Oct 2013 22:54:02 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/57887] nested non-type template parameters not declared in this scope Date: Wed, 16 Oct 2013 22:54: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: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: 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: 2013-10/txt/msg01160.txt.bz2 Content-length: 490 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57887 Paolo Carlini changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-10-16 Ever confirmed|0 |1 --- Comment #2 from Paolo Carlini --- Confirmed.