------- Comment #4 from manu at gcc dot gnu dot org 2007-10-17 11:26 ------- Does this patch makes any sense? This needs testcases (suggestions for extra testcases are welcome), Changelog, bootstrap + testing and proper submission.
--- init.c 2007-09-20 15:13:00.000000000 +0100 +++ init.c.fixed 2007-10-17 12:20:24.000000000 +0100 @@ -684,10 +684,11 @@ emit_mem_initializers (tree mem_inits) /* If these initializations are taking place in a copy constructor, the base class should probably be explicitly - initialized. */ + initialized unless it is nearly empty. */ if (extra_warnings && !arguments && DECL_COPY_CONSTRUCTOR_P (current_function_decl) - && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject))) + && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)) + && !CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (subobject)) warning (OPT_Wextra, "%Jbase class %q#T should be explicitly initialized in the " "copy constructor", current_function_decl, BINFO_TYPE (subobject)); -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2005-12-11 21:53:55 |2007-10-17 11:26:12 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5645