[PATCH] D51789: [clang] Add the no_extern_template attribute

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 14 10:13:51 PDT 2018


ldionne added a comment.

In https://reviews.llvm.org/D51789#1235096, @rsmith wrote:

> In https://reviews.llvm.org/D51789#1234903, @ldionne wrote:
>
> > I think now's a good time to bikeshed the name of the attribute if you have other suggestions.
>
>
> OK, so the semantics of this attribute are "explicit instantiation declarations or definitions applied to the enclosing class do not apply to this member", right? So it opts the member out of both `extern template` and (non-`extern`) `template`, but only when applied to an enclosing class.


Yes, but it also (obviously) opts the member out when applied to the member itself, not only to an enclosing class.

> Maybe something like `exclude_from_explicit_instantiation`? That's a little longer than I'd like, but if it's going to be hidden behind a macro most of the time I could live with it.

I like this a lot too. I thought about that one and was deterred by the length, but it may be acceptable. Realistically, it's also not an attribute we want people to use most of the time.

> Or maybe `no_transitive_instantiation`? That's less explicit about the purpose of the attribute, but is a more comfortable length.

I'm not sure this one describes what the attribute is doing sufficiently closely.

Unless we get a better suggestion soonish, I'll change it to `exclude_from_explicit_instantiation` and update the diff.


Repository:
  rC Clang

https://reviews.llvm.org/D51789





More information about the cfe-commits mailing list