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

Collapse All | Expand All | Context: (Patch / File /
)

(-)c-family/c.opt.orig (+4 lines)
 Lines 453-458   Wmain Link Here 
453
C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning
453
C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning
454
Warn about suspicious declarations of \"main\"
454
Warn about suspicious declarations of \"main\"
455
455
456
Wmeminit
457
C++ Var(warn_meminit) Warning
458
Warn about POD members which are not initialized in a constructor initialization list
459
456
Wmissing-braces
460
Wmissing-braces
457
C ObjC C++ ObjC++ Var(warn_missing_braces) Warning
461
C ObjC C++ ObjC++ Var(warn_missing_braces) Warning
458
Warn about possibly missing braces around initializers
462
Warn about possibly missing braces around initializers
(-)cp/init.c.orig (+13 lines)
 Lines 423-428   build_value_init_noctor (tree type, tsub Link Here 
423
  return build_zero_init (type, NULL_TREE, /*static_storage_p=*/false);
423
  return build_zero_init (type, NULL_TREE, /*static_storage_p=*/false);
424
}
424
}
425
425
426
/* Returns true if MEM_TYPE is a non-empty trivial type or array of such types. */
427
static bool
428
need_mem_initializer (tree mem_type)
429
{
430
    return !type_has_nontrivial_default_init (mem_type) && !is_really_empty_class (mem_type);
431
}
432
426
/* Initialize MEMBER, a FIELD_DECL, with INIT, a TREE_LIST of
433
/* Initialize MEMBER, a FIELD_DECL, with INIT, a TREE_LIST of
427
   arguments.  If TREE_LIST is void_type_node, an empty initializer
434
   arguments.  If TREE_LIST is void_type_node, an empty initializer
428
   list was given; if NULL_TREE no initializer was given.  */
435
   list was given; if NULL_TREE no initializer was given.  */
 Lines 433-438   perform_member_init (tree member, tree i Link Here 
433
  tree decl;
440
  tree decl;
434
  tree type = TREE_TYPE (member);
441
  tree type = TREE_TYPE (member);
435
442
443
  /* warn if there is no initializer for a member which will be left uninitialized */
444
  if (warn_meminit && init == NULL_TREE && need_mem_initializer (type))
445
    warning_at (DECL_SOURCE_LOCATION (current_function_decl), OPT_Wmeminit,
446
		"%qD is not initialized in the member initialization list",
447
		member);
448
436
  /* Effective C++ rule 12 requires that all data members be
449
  /* Effective C++ rule 12 requires that all data members be
437
     initialized.  */
450
     initialized.  */
438
  if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE)
451
  if (warn_ecpp && init == NULL_TREE && TREE_CODE (type) != ARRAY_TYPE)

Return to bug 2972