[Bug c++/56722] New: C++11: syntax error in for loop ends in SEGV

akim.demaille at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 25 17:24:00 GMT 2013


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.



More information about the Gcc-bugs mailing list