This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR c++/77306 - Unable to specify visibility for explicit template instantiations


On Sat, Apr 22, 2017 at 4:46 PM, James Abbatiello <abbeyj@gmail.com> wrote:
>         PR c++/77306
>         * attribs.c (decl_attributes): Allow visibility attributes on explicit
>         template instantiations.
>         * gcc-family/c-attribs.c (handle_visibility_attribute): Likewise.

This doesn't seem sufficient; any members that have already been
instantiated will still have the default visibility.  If you want to
go this way, you'll need to call reset_type_linkage when changing the
visibility of a type that's already defined.

Is there a reason you can't declare the visibility before the first
use of A<double>, e.g.

  extern template struct __attribute ((visibility("hidden"))) A<double>;

followed later by

  template class A<double>;

?

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]