On Sat, Apr 22, 2017 at 4:46 PM, James Abbatiello <[email protected]> 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