View | Details | Raw Unified | Return to bug 2972 | Differences between
and this patch

Collapse All | Expand All

(-)c.opt.orig (+4 lines)
Lines 304-309 Link Here
304
C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning
304
C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning
305
Warn about suspicious declarations of \"main\"
305
Warn about suspicious declarations of \"main\"
306
306
307
Wmeminit
308
C++ Var(warn_meminit) Warning
309
Warn about POD members which are not initialized in a constructor initialization list
310
307
Wmissing-braces
311
Wmissing-braces
308
C ObjC C++ ObjC++ Var(warn_missing_braces) Warning
312
C ObjC C++ ObjC++ Var(warn_missing_braces) Warning
309
Warn about possibly missing braces around initializers
313
Warn about possibly missing braces around initializers
(-)cp/init.c.orig (+13 lines)
Lines 414-419 Link Here
414
  return build_zero_init (type, NULL_TREE, /*static_storage_p=*/false);
414
  return build_zero_init (type, NULL_TREE, /*static_storage_p=*/false);
415
}
415
}
416
416
417
/* Returns true if MEM_TYPE is a non-empty trivial type or array of such types. */
418
static bool
419
need_mem_initializer (tree mem_type)
420
{
421
    return !type_has_nontrivial_default_init (mem_type) && !is_really_empty_class (mem_type);
422
}
423
417
/* Initialize MEMBER, a FIELD_DECL, with INIT, a TREE_LIST of
424
/* Initialize MEMBER, a FIELD_DECL, with INIT, a TREE_LIST of
418
   arguments.  If TREE_LIST is void_type_node, an empty initializer
425
   arguments.  If TREE_LIST is void_type_node, an empty initializer
419
   list was given; if NULL_TREE no initializer was given.  */
426
   list was given; if NULL_TREE no initializer was given.  */
Lines 424-429 Link Here
424
  tree decl;
431
  tree decl;
425
  tree type = TREE_TYPE (member);
432
  tree type = TREE_TYPE (member);
426
433
434
  /* warn if there is no initializer for a member which will be left uninitialized */
435
  if (warn_meminit && init == NULL_TREE && need_mem_initializer (type))
436
    warning_at (DECL_SOURCE_LOCATION (current_function_decl), OPT_Wmeminit,
437
		"%qD is not initialized in the member initialization list",
438
		member);
439
427
  /* Effective C++ rule 12 requires that all data members be
440
  /* Effective C++ rule 12 requires that all data members be
428
     initialized.  */
441
     initialized.  */
429
  if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE)
442
  if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE)

Return to bug 2972