https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71515

            Bug ID: 71515
           Summary: ICE on valid C++ code on x86_64-linux-gnu:
                    Segmentation fault (program cc1plus)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following C++ code causes an ICE when compiled with the current GCC trunk
on x86_64-linux-gnu in both 32-bit and 64-bit modes.  

It also affects 4.7.x and later, and is accepted by 4.6.x. 

It might be related to PR 70776, which also crashes 4.6.x (and at least as
early as 4.4.x.). 


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160612 (experimental) [trunk revision 237336] (GCC) 
$ 
$ g++-4.6 -c small.cpp
$ 
$ g++-trunk -c small.cpp
g++-trunk: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


---------------------------------------------------------------


template < typename, typename = int > struct A;

template < typename T > struct A < T, typename A < T >::type >
{
  A < int > *a;
};

Reply via email to