eugenis added a comment.

<string> is an interesting case.
There are no cases of visibility attribute present on an out-of-class 
definition but missing on an in-class declaration, so nothing needs to be done 
for a switch to internal_linkage.

Setting hidden visibility on an "extern template" method is probably a bad 
practice. By itself, it would break everything: extern template promises that 
this method is available externally, and hidden visibility kinda invalidates 
this promise. But is libc++ it is always accompanied by another attribute which 
sidesteps the issue: always_inline (if inlining happends) and internal_linkage 
(in all cases) emit method body in the caller's translation unit.

So, nothing would break if we leave <string> unchanged. Removing the attributes 
would add 254 exports to libc++ and not really achieve anything. Well, it could 
help with the link failure on compilers that do not support internal_linkage 
AND not always inline always_inline - are there any like this?


Repository:
  rL LLVM

http://reviews.llvm.org/D14409



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to