[Bug c++/11497] const instance of class requires ctor definition

frank6thursday at aol dot com gcc-bugzilla@gcc.gnu.org
Fri Jul 11 03:20:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11497


frank6thursday at aol dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From frank6thursday at aol dot com  2003-07-11 03:20 -------
Oops.. 
>From 8.5/9:

If no initializer is specified for an object, and the object is of
(possibly cv­qualified) non­POD class type (or
array thereof), the object shall be default­initialized; if the object
is of const­qualified type, the underlying
class type shall have a user­declared default constructor. Otherwise, if
no initializer is specified for an
object, the object and its subobjects, if any, have an indeterminate
initial value 90) ; if the object or any of its
subobjects are of const-qualified type, the program is ill­formed.

Ergo, the compiler should have rejected my code.



More information about the Gcc-bugs mailing list