rjmccall wrote:

The basic design idea behind Clang's visibility model is to treat hidden 
visibility as essentially a second grade of external linkage, external to the 
translation unit but internal to the linkage unit (i.e. image).  So what you 
pointed out about using an anonymous namespace is exactly the intent: just like 
using an internal-linkage entity in a declaration should force it to have 
internal linkage, using a hidden-visibility entity in a declaration should 
force it to have hidden visibility.

We then have to deal with the legacy that people often don't set template 
visibility right and try to patch it up with explicit visibility attributes on 
explicit instantiations and specializations.  We want to treat that as a "big 
hammer" that overrides all of our normal considerations, at least as far as 
that specific declaration goes.  This is not a problem with linkage because 
there's no way to override linkage this way.

https://github.com/llvm/llvm-project/pull/72092
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to