This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3827: No initialization of an int allocated with new int.
- To: fasbjx at free dot fr, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Subject: Re: c++/3827: No initialization of an int allocated with new int.
- From: loewis at gcc dot gnu dot org
- Date: 26 Jul 2001 05:55:52 -0000
Synopsis: No initialization of an int allocated with new int.
State-Changed-From-To: open->closed
State-Changed-By: loewis
State-Changed-When: Wed Jul 25 22:55:52 2001
State-Changed-Why:
This is not a bug, the compiler is not supposed to default-initialize object of POD types allocated in new expressions.
If the new-initializer is omitted:
If T is a (possibly cv-qualified) non-POD class type (or array thereof), the object is default-initialized (8.5)
Otherwise, the object created has indeterminate value.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3827&database=gcc