Legal c++ one-liner doesn't compile with gcc 2.95.2

Phil Edwards pedwards@disaster.jaj.com
Mon Jul 10 13:50:00 GMT 2000


Is this to do with his "magical NULL" post to comp.std.c++, by any chance?


> ------------------
> const class { } a;
> ------------------

I don't know that this is legal.  [8.5]/9 says

#   ...if the object is of const-qualified type, the underlying class
#   type shall have a user-declared default constructor.
                      ^^^^^^^^^^^^^


Phil
(who approved the posting to c.s.c++, which was probably generated by an
email from me to Scott asking an unrelated question about his "magical
NULL" example... have I spawned a monster here?)



More information about the Gcc-bugs mailing list