{ "stdcall", EXT_ATTR_STDCALL, "stdcall" },
{ "fastcall", EXT_ATTR_FASTCALL, "fastcall" },
{ "no_arg_check", EXT_ATTR_NO_ARG_CHECK, NULL },
+ { "deprecated", EXT_ATTR_DEPRECATED, NULL },
{ NULL, EXT_ATTR_LAST, NULL }
};
/* typebound procedure: Assume the worst. */
gfc_current_ns->proc_name->attr.array_outer_dependency = 1;
+ if (expr->value.function.esym
+ && expr->value.function.esym->attr.ext_attr & (1 << EXT_ATTR_DEPRECATED))
+ gfc_warning (OPT_Wdeprecated_declarations,
+ "Using function %qs at %L is deprecated",
+ sym->name, &expr->where);
return t;
}
/* Typebound procedure: Assume the worst. */
gfc_current_ns->proc_name->attr.array_outer_dependency = 1;
+ if (c->resolved_sym
+ && c->resolved_sym->attr.ext_attr & (1 << EXT_ATTR_DEPRECATED))
+ gfc_warning (OPT_Wdeprecated_declarations,
+ "Using subroutine %qs at %L is deprecated",
+ c->resolved_sym->name, &c->loc);
+
return t;
}
if (t && flag_coarray == GFC_FCOARRAY_LIB && gfc_is_coindexed (e))
add_caf_get_intrinsic (e);
+ if (sym->attr.ext_attr & (1 << EXT_ATTR_DEPRECATED) && sym != sym->result)
+ gfc_warning (OPT_Wdeprecated_declarations,
+ "Using variable %qs at %L is deprecated",
+ sym->name, &e->where);
/* Simplify cases where access to a parameter array results in a
single constant. Suppress errors since those will have been
issued before, as warnings. */
if (sym->value == NULL)
return;
+ if (sym->attr.ext_attr & (1 << EXT_ATTR_DEPRECATED))
+ gfc_warning (OPT_Wdeprecated_declarations,
+ "Using parameter %qs declared at %L is deprecated",
+ sym->name, &sym->declared_at);
+
if (sym->value->expr_type == EXPR_STRUCTURE)
t= resolve_structure_cons (sym->value, 1);
else
--- /dev/null
+! { dg-do compile }
+
+module m
+ implicit none
+ integer :: A
+ integer, parameter :: PARM = 5 ! { dg-warning "Using parameter 'parm' declared at .1. is deprecated" }
+!GCC$ ATTRIBUTES DEPRECATED :: A, foo, func, parm
+contains
+subroutine foo
+end
+integer function func()
+ func = 42
+end
+subroutine bar
+ integer :: i
+ call foo ! { dg-warning "Using subroutine 'foo' at .1. is deprecated" }
+ print *, A ! { dg-warning "Using variable 'a' at .1. is deprecated" }
+ i = func() ! { dg-warning "Using function 'func' at .1. is deprecated" }
+ print *, PARM
+end
+
+end module m
+
+use m ! { dg-warning "Using parameter 'parm' declared at .1. is deprecated" }
+ integer :: i
+ call foo ! { dg-warning "Using subroutine 'foo' at .1. is deprecated" }
+ print *, A ! { dg-warning "Using variable 'a' at .1. is deprecated" }
+ i = func() ! { dg-warning "Using function 'func' at .1. is deprecated" }
+ print *, PARM
+end