Bug#195468: g++-3.3: default construction fails when no explicit default constructor defined
Herbert Valerio Riedel <hvr@se-linux.ifs.tuwien.ac.at> writes:
> ...so... is _still_ not a buggy behaviour??
No. Look at 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.
Your objects have const-qualified type, and the underlying class has
no user-declared default constructor, hence your program is
ill-formed.
Whether there would be any members with indeterminate state is
irrelevant, as is the fact that three other compilers fail to find
that ill-formedness.
Regards,
Martin
Reply to: