[PATCH] D14409: Remove visibility attributes from out-of-class method definitions in iostreams.

Evgeniy Stepanov via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 9 15:00:35 PST 2015


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





More information about the cfe-commits mailing list