[libcxx-commits] [libcxx] [libc++] Introduce ABI sensitive areas to avoid requiring _LIBCPP_HIDE_FROM_ABI everywhere (PR #131156)

James Y Knight via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 27 14:47:55 PDT 2025


jyknight wrote:

> You say that, but there has been a single report of someone affected by this so far. That makes the claim that this is common somewhat questionable.

I am commenting because I also have breakage due to this, independently of dschuff. So, that's at least 2. I'm not sure how many more independent reports of breakage you could expect from a PR that's only a week old.

> It's not though. See https://godbolt.org/z/GEbMnod1x. Note that hash<S>::func() has hidden visibility, even though the first namespace has an explicit markup that it should have default visibility.

Ahhh, great point! I actually completely misunderstood how the visibility propagation works. (Due in part to failing to properly read the results of my testing). So, ignore the example code in my previous message, it totally bogus.

What is actually happening is _not_ propagation of the namespace decl -- we actually don't do that! (nor GCC). Rather, what we have here is propagation from the visibility of the template, to any explicit specialization of the template. The code which does that propagation is [here](https://github.com/llvm/llvm-project/blob/0354491bea04beb6d1db44f8ca522bfc597ab0d3/clang/lib/AST/Decl.cpp#L1249).


https://github.com/llvm/llvm-project/pull/131156


More information about the libcxx-commits mailing list