This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/3738
- To: nobody at gcc dot gnu dot org
- Subject: Re: libstdc++/3738
- From: Luca Formaggia <Luca dot Formaggia at epfl dot ch>
- Date: 27 Aug 2001 17:36:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Luca Formaggia <Luca dot Formaggia at epfl dot ch>
The following reply was made to PR libstdc++/3738; it has been noted by GNATS.
From: Luca Formaggia <Luca.Formaggia@epfl.ch>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: libstdc++/3738
Date: Mon, 27 Aug 2001 19:31:48 +0200
--------------C8F330E8ED016AC23E78F12E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Ok, you are right.
By reading again B. Stroustrup more carefully I now see that it was all there!
Thanks to you all and sorry to have wasted some of your time.
Luca
Alexandre Oliva wrote:
> On Aug 24, 2001, Luca Formaggia <Luca.Formaggia@epfl.ch> wrote:
>
> > Well, for static integral constant member it should work, accordind to
> > B.Stroustrup, 3rd Ed., pag 249, unless the standard has changed since then.
>
> The ISO C++ Standard says all static data members referenced in a
> program must be defined (outside the class body, as opposed to only
> declared inside it), but they must omit the initializer if the
> declaration already initializes it. Note, however, that no diagnostic
> is required in case this rule is violated, which means the compiler is
> allowed, but not required to, replace references to the static data
> member with the constant used to initialize them.
--
--------------------------------------------------------------------------
Luca Formaggia | mailto:Luca.Formaggia@epfl.ch
Modelling and Scientific Computing | http://dmawww.epfl.ch/~forma
Mathematics Department | office: MA C2 524
Ecole Polytechnique Federale de Lausanne | voice: +4121 6934267
CH-1015 Lausanne, Switzerland | fax: +4121 6934303
--------------------------------------------------------------------------
--------------C8F330E8ED016AC23E78F12E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Ok, you are right.
<p>By reading again B. Stroustrup more carefully I now see that it
was all there!
<p>Thanks to you all and sorry to have wasted some of your time.
<p>Luca
<p>Alexandre Oliva wrote:
<blockquote TYPE=CITE>On Aug 24, 2001, Luca Formaggia <Luca.Formaggia@epfl.ch>
wrote:
<p>> Well, for static integral constant member it should work, accordind
to
<br>> B.Stroustrup, 3rd Ed., pag 249, unless the standard has changed since
then.
<p>The ISO C++ Standard says all static data members referenced in a
<br>program must be defined (outside the class body, as opposed to only
<br>declared inside it), but they must omit the initializer if the
<br>declaration already initializes it. Note, however, that no diagnostic
<br>is required in case this rule is violated, which means the compiler
is
<br>allowed, but not required to, replace references to the static data
<br>member with the constant used to initialize them.</blockquote>
<pre>--
--------------------------------------------------------------------------
Luca Formaggia | <A HREF="mailto:Luca.Formaggia@epfl.ch">mailto:Luca.Formaggia@epfl.ch</A>
Modelling and Scientific Computing | <A HREF="http://dmawww.epfl.ch/~forma">http://dmawww.epfl.ch/~forma</A>
Mathematics Department | office: MA C2 524
Ecole Polytechnique Federale de Lausanne | voice: +4121 6934267
CH-1015 Lausanne, Switzerland | fax: +4121 6934303
--------------------------------------------------------------------------</pre>
</html>
--------------C8F330E8ED016AC23E78F12E--