From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1788 invoked by alias); 10 Feb 2005 16:14:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1606 invoked by uid 48); 10 Feb 2005 16:14:13 -0000 Date: Thu, 10 Feb 2005 20:32:00 -0000 Message-ID: <20050210161413.1605.qmail@sourceware.org> From: "reichelt at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040904185519.17323.niemayer@isg.de> References: <20040904185519.17323.niemayer@isg.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/17323] [3.4/4.0 regression] ICE on invalid code if static member array initialized with size computed as division by zero X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg00876.txt.bz2 List-Id: ------- Additional Comments From reichelt at gcc dot gnu dot org 2005-02-10 16:14 ------- Here's a reduced testcase without sizeof: ================================= template 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