public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@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
Date: Thu, 10 Feb 2005 20:32:00 -0000	[thread overview]
Message-ID: <20050210161413.1605.qmail@sourceware.org> (raw)
In-Reply-To: <20040904185519.17323.niemayer@isg.de>


------- 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


  parent reply	other threads:[~2005-02-10 16:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-04 18:55 [Bug c++/17323] New: " niemayer at isg dot de
2004-09-04 18:56 ` [Bug c++/17323] " niemayer at isg dot de
2004-09-06 16:13 ` lerdsuwa at gcc dot gnu dot org
2004-09-06 16:56 ` giovannibajo at libero dot it
2004-09-07 23:53 ` bangerth at dealii dot org
2004-09-08  7:04 ` pinskia at gcc dot gnu dot org
2005-02-10 20:32 ` reichelt at gcc dot gnu dot org [this message]
2005-05-19 17:36 ` [Bug c++/17323] [3.4/4.0/4.1 regression] " mmitchel at gcc dot gnu dot org
2005-06-14  8:31 ` reichelt at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050210161413.1605.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).