be freed. */
if (alloc_fn)
{
- if ((complain & tf_warning)
- && !placement)
+ if ((complain & tf_warning) && !placement)
{
+ auto_diagnostic_group d;
bool w = warning (0,
"no corresponding deallocation function for %qD",
alloc_fn);
}
/* Now generate an error message depending on calculated access. */
+ auto_diagnostic_group d;
if (no_access_reason == ak_private)
{
if (issue_error)
{
int complained = 0;
conversion *t = convs;
+ auto_diagnostic_group d;
/* Give a helpful error if this is bad because of excess braces. */
if (BRACE_ENCLOSED_INITIALIZER_P (expr)
if (complain & tf_error)
{
/* Call build_user_type_conversion again for the error. */
+ auto_diagnostic_group d;
int flags = (convs->need_temporary_p
? LOOKUP_IMPLICIT : LOOKUP_NORMAL);
build_user_type_conversion (totype, convs->u.expr, flags, complain);
{
if (complain & tf_error)
{
+ auto_diagnostic_group d;
sorry ("passing arguments to ellipsis of inherited constructor "
"%qD", cand->fn);
inform (DECL_SOURCE_LOCATION (cand->fn), "declared here");
const char *suggest = "";
bool warned = false;
+ auto_diagnostic_group d;
switch (DECL_FUNCTION_CODE (fndecl))
{
case BUILT_IN_MEMSET:
maybe_warn_about_constant_value (location_t loc, tree decl)
{
static bool explained = false;
+ auto_diagnostic_group d;
if (cxx_dialect >= cxx17
&& warn_interference_size
&& !OPTION_SET_P (param_destruct_interfere_size)
{
if (!allow_non_constant && !non_constant_p)
{
+ auto_diagnostic_group d;
if (DECL_LANG_SPECIFIC (heap_var))
error ("%qE is not a constant expression because it refers to "
"exception object allocated with "
{
if (!allow_non_constant && !non_constant_p)
{
+ auto_diagnostic_group d;
error ("%qE is not a constant expression because allocated "
"storage has not been deallocated", t);
inform (DECL_SOURCE_LOCATION (heap_var), "allocated here");
if (!dependent_type_p (TREE_TYPE (decl))
&& !CP_TYPE_CONST_P (TREE_TYPE (decl)))
{
+ auto_diagnostic_group d;
error_at (location,
"a value parameter used in a postcondition must be const");
inform (DECL_SOURCE_LOCATION (decl), "parameter declared here");
tree t2 = FUNCTION_FIRST_USER_PARM (newdecl);
for (; t1 && t1 != void_list_node;
- t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
+ t1 = TREE_CHAIN (t1), t2 = TREE_CHAIN (t2))
{
if (parm_used_in_post_p (t1))
{
&& !CP_TYPE_CONST_P (TREE_TYPE (t2))
&& !TREE_READONLY (t2))
{
+ auto_diagnostic_group d;
error_at (DECL_SOURCE_LOCATION (t2),
- "value parameter %qE used in a postcondition must be const", t2);
+ "value parameter %qE used in a postcondition must be "
+ "const", t2);
inform (DECL_SOURCE_LOCATION (olddecl),
- "previous declaration here");
+ "previous declaration here");
}
}
}
{
if (computed)
diag_kind = diagnostics::kind::warning;
+ auto_diagnostic_group d;
bool complained
= emit_diagnostic (diag_kind, loc, 0,
decl ? G_("jump to label %qD")
loc = EXPR_LOC_OR_LOC (variant,
DECL_SOURCE_LOCATION (variant));
}
+ auto_diagnostic_group d;
error_at (loc, "argument %d of %qE must be of %<omp_interop_t%>",
args->length () + 1, variant);
inform (EXPR_LOCATION (TREE_PURPOSE (append_args_list)),
i++, varg = TREE_CHAIN (varg))
if (!varg || !c_omp_interop_t_p (TREE_VALUE (varg)))
{
+ auto_diagnostic_group d;
error_at (DECL_SOURCE_LOCATION (variant),
"argument %d of %qD must be of %<omp_interop_t%>",
nbase_args + i + 1, variant);
{
if (diag)
{
+ auto_diagnostic_group d;
error ("uninitialized const member in %q#T",
current_class_type);
inform (DECL_SOURCE_LOCATION (field),
{
if (diag)
{
+ auto_diagnostic_group d;
error ("uninitialized reference member in %q#T",
current_class_type);
inform (DECL_SOURCE_LOCATION (field),
&& (!init_use_destroy_seen
|| (init_seen && init_no_targetsync_clause)))
{
+ auto_diagnostic_group d;
error_at (OMP_CLAUSE_LOCATION (depend_clause),
"%<depend%> clause requires action clauses with "
"%<targetsync%> interop-type");
/* Check for virtual bases. */
if (CLASSTYPE_VBASECLASSES (type))
{
+ auto_diagnostic_group d;
if (warning (OPT_Wattributes, "%<trivial_abi%> cannot be applied to %qT",
type))
inform (input_location, "has a virtual base");
/* Check for virtual member functions. */
if (TYPE_POLYMORPHIC_P (type))
{
+ auto_diagnostic_group d;
if (warning (OPT_Wattributes, "%<trivial_abi%> cannot be applied to %qT",
type))
inform (input_location, "is polymorphic");
if (TREE_ADDRESSABLE (base_type))
{
+ auto_diagnostic_group d;
if (warning (OPT_Wattributes,
"%<trivial_abi%> cannot be applied to %qT", type))
inform (input_location, "has a non-trivial base class %qT",
if (CLASS_TYPE_P (field_type) && TREE_ADDRESSABLE (field_type))
{
+ auto_diagnostic_group d;
if (warning (OPT_Wattributes,
"%<trivial_abi%> cannot be applied to %qT", type))
inform (input_location, "has a non-static data member "
/* Check that not all copy/move constructors are deleted. */
if (!classtype_has_non_deleted_copy_or_move_ctor (type))
{
+ auto_diagnostic_group d;
if (warning (OPT_Wattributes, "%<trivial_abi%> cannot be applied to %qT",
type))
inform (input_location,
tree field = next_aggregate_field (TYPE_FIELDS (type));
if (field && DECL_FIELD_IS_BASE (field))
{
+ auto_diagnostic_group d;
if (warning_at (loc, 0, "initializing a base class of type %qT "
"results in object slicing", TREE_TYPE (field)))
inform (loc, "remove %<{ }%> around initializer");