From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15752 invoked by alias); 6 Jun 2013 21:16:57 -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 15683 invoked by uid 48); 6 Jun 2013 21:16:53 -0000 From: "david.abdurachmanov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55149] capturing VLA in lambda Date: Thu, 06 Jun 2013 21:16: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: david.abdurachmanov at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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-06/txt/msg00313.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55149 David Abdurachmanov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david.abdurachmanov at gmail dot c | |om --- Comment #9 from David Abdurachmanov --- I am looking into 55520, which is marked a being duplicate of this ticket. The example 1 below from 55520, still ICE on 4.9.0 (r199649). Yet it's marked as RESOLVED FIXED. Jason, w/ 4.8.{0,1} VLA capture by reference in lambda works fine, or at least compiles. Yet it now fails w/ 4.9.0. Details in example 2. 1. Is 55520 and this bug really RESOLVED FIXED? Example 1 produces ICE under 4.9.0. 2. Does capturing VLA by reference works **only** in 4.9.0? Example 2 compiles under 4.8.{0,1}. 3. Looking at example 2, I would say capturing VLA by reference doesn't work in 4.9.0, or am I missing something here? Should I file a bug report? ### EXAMPLE 1 ### int main(int argc, char** argv) { int x[1][argc]; [&x](int i) { x[0][i] = 0; }(5); return 0; } ### GCC OUTPUT ### test2.cxx: In lambda function: test2.cxx:7:15: internal compiler error: in expand_expr_real_1, at expr.c:9361 x[0][i] = 0; ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. ### EXAMPLE 2 ### 134 uint32_t index[nt]; 135 float e[nt]; 136 for (std::size_t k=0; k!=nt; ++k) { 137 e[k]=towers[k].eta(); 138 index[k]=k; 139 std::push_heap(index,index+k+1,[&e](uint32_t i, uint32_t j){ return e[i]