https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98620
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch CC| |mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Can be fixed like this: --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1563,6 +1563,7 @@ process_init_constructor_record (tree type, tree init, int nested, int flags, /* Warn when some struct elements are implicitly initialized. */ if ((complain & tf_warning) + && !cp_unevaluated_operand && !EMPTY_CONSTRUCTOR_P (init)) warning (OPT_Wmissing_field_initializers, "missing initializer for member %qD", field); @@ -1593,6 +1594,7 @@ process_init_constructor_record (tree type, tree init, int nested, int flags, /* Warn when some struct elements are implicitly initialized to zero. */ if ((complain & tf_warning) + && !cp_unevaluated_operand && !EMPTY_CONSTRUCTOR_P (init)) warning (OPT_Wmissing_field_initializers, "missing initializer for member %qD", field);