public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: James Kanze <kanze@gabi-soft.de> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/6785: Core dump from g++ 3.0.4 (on Linux) Date: Fri, 24 May 2002 03:36:00 -0000 [thread overview] Message-ID: <20020524103606.3085.qmail@sources.redhat.com> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1569 bytes --] The following reply was made to PR c++/6785; it has been noted by GNATS. From: James Kanze <kanze@gabi-soft.de> To: gcc-gnats@gcc.gnu.org Cc: nobody@gcc.gnu.org Subject: Re: c++/6785: Core dump from g++ 3.0.4 (on Linux) Date: 24 May 2002 12:31:47 +0200 gcc-gnats@gcc.gnu.org writes: |> It has the internal identification `c++/6785'. I've got a much, much smaller example which triggers the error: --------------------------------------------------- #include <cstddef> template< typename T, size_t N > size_t size( T (&a)[ N ] ) { return N ; } void f() { static char const s[] = "abc" ; int buf[ size( s ) ] ; size_t r = size( buf ) ; } --------------------------------------------------- I was unintentionally using a g++ extension, but the problem occurs when I try and instantiate a template similar to the above on an array with non-constant bounds. This should IMHO be an error -- the standard requires that the instantiation value for a template be a compile time constant, and with variable length arrays, the length of the array is NOT. The easiest fix would be to just turn off support for variable length arrays in g++. I don't think that that is acceptable, however, as it would break existing code. -- James Kanze mailto:kanze@gabi-soft.de Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung Ziegelhüttenweg 17a, 60598 Frankfurt, Germany Tel. +49(0)179 2607481
next reply other threads:[~2002-05-24 10:36 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-05-24 3:36 James Kanze [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-06-01 9:08 lerdsuwa 2002-05-23 8:26 kanze
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=20020524103606.3085.qmail@sources.redhat.com \ --to=kanze@gabi-soft.de \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).