Hi! In http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195550 Jason changed the default assemble_visibility target hook to avoid complaining on DECL_ARTIFICIAL decls, even when they have some visibility set (the C++ FE now sets visibility of construction vtables), this patch ports that to solaris and winnt private variants of the hook.
Tested with Solaris cross on the testcase, ok for trunk? 2013-02-04 Jakub Jelinek <ja...@redhat.com> PR libstdc++/54314 * config/i386/winnt.c (i386_pe_assemble_visibility): Don't warn about visibility on artificial decls. * config/sol2.c (solaris_assemble_visibility): Likewise. --- gcc/config/i386/winnt.c.jj 2013-01-11 09:03:06.075488067 +0100 +++ gcc/config/i386/winnt.c 2013-02-04 11:40:31.314181511 +0100 @@ -250,8 +250,9 @@ i386_pe_assemble_visibility (tree decl, if (!decl || !lookup_attribute ("visibility", DECL_ATTRIBUTES (decl))) return; - warning (OPT_Wattributes, "visibility attribute not supported " - "in this configuration; ignored"); + if (!DECL_ARTIFICIAL (decl)) + warning (OPT_Wattributes, "visibility attribute not supported " + "in this configuration; ignored"); } /* This is used as a target hook to modify the DECL_ASSEMBLER_NAME --- gcc/config/sol2.c.jj 2013-01-11 09:03:07.000000000 +0100 +++ gcc/config/sol2.c 2013-02-04 11:40:51.417065051 +0100 @@ -124,8 +124,7 @@ solaris_output_init_fini (FILE *file, tr the visibility type VIS, which must not be VISIBILITY_DEFAULT. */ void -solaris_assemble_visibility (tree decl ATTRIBUTE_UNUSED, - int vis ATTRIBUTE_UNUSED) +solaris_assemble_visibility (tree decl, int vis ATTRIBUTE_UNUSED) { #ifdef HAVE_GAS_HIDDEN /* Sun as uses .symbolic for STV_PROTECTED. STV_INTERNAL is marked as @@ -152,8 +151,9 @@ solaris_assemble_visibility (tree decl A assemble_name (asm_out_file, name); fprintf (asm_out_file, "\n"); #else - warning (OPT_Wattributes, "visibility attribute not supported " - "in this configuration; ignored"); + if (!DECL_ARTIFICIAL (decl)) + warning (OPT_Wattributes, "visibility attribute not supported " + "in this configuration; ignored"); #endif } Jakub