------- Additional Comments From reichelt at gcc dot gnu dot org  2005-02-10 
16:14 -------
Here's a reduced testcase without sizeof:

=================================
template<int N> struct A
{
    static const int i = 8/N;
    char c[i];
};

A<0> a;
=================================

The error message is:

mmm.cc: In instantiation of 'A<0>':
mmm.cc:7:   instantiated from here
mmm.cc:3: warning: division by zero in '8 / 0'
g++: Internal error: Segmentation fault (program cc1plus)

The ICE appears with 3.4.0. Before I get the following error message:

mmm.cc: In instantiation of `A<0>':
mmm.cc:7:   instantiated from here
mmm.cc:3: warning: division by zero in `8 / 0'
mmm.cc:7: error: variable-size type declared outside of any function
mmm.cc:7: error: variable-size type declared outside of any function


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
            Summary|ICE on invalid code if      |[3.4/4.0 regression] ICE on
                   |static member array         |invalid code if static
                   |initialized with size       |member array initialized
                   |computed as division by zero|with size computed as
                   |                            |division by zero
   Target Milestone|---                         |3.4.4


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

Reply via email to