Issue 133725
Summary `std::any` is still broken with `visbility=hidden` and `libc++` when used cross DSO boundaries
Labels libc++
Assignees
Reporter milianw
    This is related to https://github.com/llvm/llvm-project/issues/48743 which seems to have fixed this issue for `libstdc++`, but apparently there are remaining problems when using `libc++`:

libc++ with clang-20.1.0: https://godbolt.org/z/4TW4rMYoe note that the typeid name is the same, but the hash differs already:
```
NSt3__110shared_ptrI10WrappedIntEE 134520565932116
NSt3__110shared_ptrI10WrappedIntEE 105617327562758
```

this then leads to:

```
libc++abi: terminating due to uncaught exception of type std::bad_any_cast: bad any cast
Program terminated with signal: SIGSEGV
```

If we don't enforce `libc++` and thus default to `libstdc++` then everything works:

https://godbolt.org/z/bsGvfzWsh
```
St10shared_ptrI10WrappedIntE 6190920035151885185
St10shared_ptrI10WrappedIntE 6190920035151885185
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to