public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mike Stump <mrs@windriver.com>
To: aoliva@redhat.com, nbecker@fred.net
Cc: gcc@gcc.gnu.org
Subject: Re: Why is this code accepted?
Date: Tue, 17 Apr 2001 19:41:00 -0000	[thread overview]
Message-ID: <200104180241.TAA26950@kankakee.wrs.com> (raw)

> Cc: Mike Stump <mrs@windriver.com>, gcc@gcc.gnu.org
> From: Alexandre Oliva <aoliva@redhat.com>
> Date: 17 Apr 2001 18:51:45 -0300

> On Apr 17, 2001, nbecker@fred.net wrote:

> > If it doesn't work shouldn't gcc reject it?

Oh, wait, I know what's wrong...

g++  -pedantic-errors -ansi -S t.cc
t.cc:13: ISO C++ forbids initialization of member constant `a' of non-integral 
   type `const double[]'

It works as designed, and if we add:

const double X::a[2];

to the program to meet the logical requirements of the extension, and
don't ask for the error, then it works as expected.  I was thinking
of a language without the clause:

4 If a  static data member is of  const integral or   const  enumeration
  type,  its  declaration  in  the  class  definition  can  specify  a
  constant-initializer which shall be an  integral  constant  expression
  (5.19).   In  that  case,  the  member can appear in integral constant
  expressions within its scope.  The member shall still be defined in  a  |
  namespace  scope  if it is used in the program and the namespace scope  |
  definition shall not contain an  initializer.

in it, sorry for the confusion.  This wording first appeared in the 95
(95-0029) version of the working paper, so it is new...  :-)

So, no, no extension was broken, and no, no bug is present.

             reply	other threads:[~2001-04-17 19:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-17 19:41 Mike Stump [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-17 17:20 Mike Stump
2001-04-16 14:58 Mike Stump
2001-04-16 20:16 ` Alexandre Oliva
2001-04-17  4:57   ` nbecker
2001-04-17 14:52     ` Alexandre Oliva
2001-04-16 13:27 nbecker

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=200104180241.TAA26950@kankakee.wrs.com \
    --to=mrs@windriver.com \
    --cc=aoliva@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=nbecker@fred.net \
    /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).