libcxxrt seems to lack some features that are present in libc++abi

Dimitry Andric dim at FreeBSD.org
Sat Jul 29 16:55:26 UTC 2017


On 29 Jul 2017, at 18:14, Oleg Lelchuk <oleglelchuk at gmail.com> wrote:
> 
> libcxxrt seems to lack some features that are present in libc++abi. If I
> compile this code and link it against libcxxrt:
> 
> #include <iostream>
> #include <boost/type_index.hpp>
> 
> int main()
> {
>        int&& ref{4};
>        std::cout <<
> boost::typeindex::type_id_with_cvr<decltype(ref)>().pretty_name() <<
> std::endl;
> }
> 
> Then I get the message: "Abort (core dumped)". But if I link this code
> against libc++abi, then I get
> 
> the output "int&&". It seems to me libcxxrt doesn't know how to deal
> with rvalue references.

It's not that, it cannot demangle the returned string from boost, which
appears to be:

  N5boost9typeindex6detail9cvr_saverIOiEE

and which demangles (with c++filt) to:

  boost::typeindex::detail::cvr_saver<int&&>

Boost is throwing a std::runtime_error("Type name demangling failed")
object here, which should obviously be caught somewhere.

The demangler in libcxxrt is indeed rather old, and we should replace it
with something newer.  I'm not sure if the demangler of libc++abi is the
right one yet, since upstream seems to still be discussing which of
their three (or thereabouts) demanglers should be *the* LLVM demangler.

Ed, IIRC you had some looks at this before, do you have any preference?

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20170729/4f7d7619/attachment.sig>


More information about the freebsd-toolchain mailing list