https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26989
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The G++ code now uses:
if (is_attribute_p ("visibility", name))
and the test that was failing uses:
// { dg-require-visibility "" }
which also depends on whether the attribute is supported:
###############################
# proc check_visibility_available { what_kind }
###############################
# The visibility attribute is only support in some object formats
# This proc returns 1 if it is supported, 0 if not.
# The argument is the kind of visibility, default/protected/hidden/internal.
proc check_visibility_available { what_kind } {
if [string match "" $what_kind] { set what_kind "hidden" }
return [check_no_compiler_messages visibility_available_$what_kind object "
void f() __attribute__((visibility(\"$what_kind\")));
void f() {}
"]
}
So I think this is probably doing the right thing for all targets now.