[cfe-dev] Clang emits unreachable `internal linkage` constructor
Reid Kleckner via cfe-dev
cfe-dev at lists.llvm.org
Wed Oct 19 09:48:04 PDT 2016
On Wed, Oct 19, 2016 at 9:21 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:
> It seems a general issue though: how do you mix visibility hidden and
> external template? This is fine if you link statically, but can’t be
> exported outside of a DSO.
> Should we design a warning for when we mix external template with
> visibility hidden?
>
I don't think we should warn on that. I think if someone uses hidden
visibility and extern template decls, it means they know they will
statically link in a definition of that template. That seems like a
legitimate use case.
> Also the intent for libc++ seems that we’d like most of the class to be
> external template but for some method. Maybe it could be achieved with a
> base class that would be external template, and the derived wouldn’t? (The
> derived would contain the current “hidden” method).
>
I don't think I fully understand the way the _LIBCPP_INLINE_VISIBILITY is
applied to basic_string, so I couldn't say for sure. I can't tell if
libc++.dylib is supposed to provide basic_string symbols or not.
> We have another thread for this: http://lists.llvm.org/
> pipermail/cfe-dev/2016-October/051151.html ; feel free to chime in there!
>
Neat. These things get lost during post-vacation triage. =P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161019/66da831c/attachment.html>
More information about the cfe-dev
mailing list