public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: James Abbatiello <abbeyj@gmail.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
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: <CADzB+2==3RNvhryEGHjinUZoxKN9Bs7KQhGRXVwsNb9m3RCiFA@mail.gmail.com> (raw)
In-Reply-To: <20170422204640.47837-1-abbeyj@gmail.com>

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

      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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to='CADzB+2==3RNvhryEGHjinUZoxKN9Bs7KQhGRXVwsNb9m3RCiFA@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=abbeyj@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).