#include "internal-fn.h"
#include "stringpool.h"
#include "attribs.h"
+#include "decl.h"
#include "gcc-rich-location.h"
/* The various kinds of conversion. */
}
else
{
- /* If FN is marked deprecated, then we've already issued a deprecated-use
- warning from mark_used above, so avoid redundantly issuing another one
- from build_addr_func. */
- warning_sentinel w (warn_deprecated_decl);
+ /* If FN is marked deprecated or unavailable, then we've already
+ issued a diagnostic from mark_used above, so avoid redundantly
+ issuing another one from build_addr_func. */
+ auto w = make_temp_override (deprecated_state,
+ UNAVAILABLE_DEPRECATED_SUPPRESS);
fn = build_addr_func (fn, complain);
if (fn == error_mark_node)
--- /dev/null
+// { dg-do compile }
+void foo() __attribute__((unavailable));
+void bar () {
+ foo (); // { dg-bogus "is unavailable.*is unavailable" }
+ // { dg-error "is unavailable" "" { target *-*-* } .-1 }
+}