Try to compile the following code in a cpp file, gcc crashes. Working on Redhat 
7.2.

#include <assert.h>

#define b 5
int f;
int foobar(int foo, int bar = (assert(f>=b), funcPtr)(), int foob=some_int);

Reading specs from
/shared/i80386linux/compiler/gcc3.2/linux2.4/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ../configure
--prefix=/user/unicore/i80386linux/compiler/gcc3.2/linux2.4
--enable-languages=c,c++ --enable-threads=posix --enable-shared
--enable-__cxa_atexit
Thread model: posix
gcc version 3.2

-- 
           Summary: internal error: Segmentation fault for valid code
                    segment
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: asachdeva at gmail dot com
                CC: asachdeva at gmail dot com,gcc-bugs at gcc dot gnu dot
                    org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18391

Reply via email to