<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 13, 2016 at 10:46 PM, Mehdi Amini via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The problem is that the linkage “available_externally" is a “lie”: there is an external template instantiation in the header, but it is marked “visibility hidden”. So the function cannot be linked to in the libc++ dylib. (I think it’d work with a static libc++).<br></blockquote><div><br></div><div>IMO this is the real problem. If basic_string isn't actually available externally, why have explicit template instaniation declarations in <string>? IIRC John put these back for some reason, but if all of basic_string is always_inline, what is the point? </div><div><br></div><div>I also think libc++ should stop abusing always_inline for linkage purposes. We should use __attribute__((internal_linkage)) instead, and allow the optimizer to make informed inlining decisions.</div></div></div></div>