From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9054 invoked by alias); 25 Mar 2013 17:24:04 -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 9036 invoked by uid 48); 25 Mar 2013 17:23:58 -0000 From: "akim.demaille at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56722] New: C++11: syntax error in for loop ends in SEGV Date: Mon, 25 Mar 2013 17:24: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: akim.demaille 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-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-03/txt/msg01796.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56722 Bug #: 56722 Summary: C++11: syntax error in for loop ends in SEGV Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: akim.demaille@gmail.com Probably because of Boost.Foreach, I had a comma instead of a colon to separate the iteration variable from the range. GCC did not like that. $ cat segv.cc int main() { for (const auto& i, 21) i; } $ g++-mp-4.8 -Wall -std=c++11 segv.cc segv.cc: In function 'int main()': segv.cc:3:20: internal compiler error: Segmentation fault: 11 for (const auto& i, 21) ^ segv.cc:3:20: internal compiler error: Abort trap: 6 g++-mp-4.8: internal compiler error: Abort trap: 6 (program cc1plus) zsh: abort g++-mp-4.8 -Wall -std=c++11 segv.cc $ g++-mp-4.8 --version g++-mp-4.8 (MacPorts gcc48 4.8-20130321_0) 4.8.0 20130321 (prerelease) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.