[Bug c++/26989] C++ front-end (and others parts of GCC) use the wrong check to see if hidden visibility is there

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 3 08:40:00 GMT 2019


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.


More information about the Gcc-bugs mailing list