public inbox for
 help / color / mirror / Atom feed
From: Jason Merrill <>
To: James Abbatiello <>
Cc: gcc-patches List <>
Subject: Re: [PATCH] PR c++/77306 - Unable to specify visibility for explicit template instantiations
Date: Wed, 24 May 2017 19:28:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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



      parent reply	other threads:[~2017-05-24 19:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-22 23:32 James Abbatiello
2017-05-22  4:37 ` James Abbatiello
2017-05-30 17:50   ` Nathan Sidwell
2017-05-24 19:28 ` Jason Merrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).