This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: found bug
- To: "Andre Karalus" <Andre dot Karalus at Schumann-AG dot de>
- Subject: Re: found bug
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 12 Jun 1998 19:24:23 -0300
- Cc: <egcs-patches at cygnus dot com>
- References: <m0ykPiD-000c3zC@Gate.Schumann-AG.DE>
Andre Karalus <Andre.Karalus@Schumann-AG.de> writes:
> !!! Please forward this mail to the right recipient, if it's wrong here.
This should have been reported to egcs-bugs@cygnus.com.
[ BTW, shouldn't we restrict egcs-patches so that only subscribers can
post? ]
> struct Test { int i; };
> const Test err;
> $ gcc err.cpp -lstdc++
> $ err.cpp:11: uninitialized const `err'
> This compiles on other platforms such as VC++ 5.0
VC++ is wrong. The FDIS says: [dcl.init]
9 If no initializer is specified for an object, [...]
if the object is of const-quali-
fied type, the underlying class type shall have a user-declared
default constructor. [...]
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil