This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: found bug


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]