Boost C++ Libraries: Ticket #4763: boost/units/detail/utility.hpp uses gcc demangle API which is not available on clang https://svn.boost.org/trac10/ticket/4763 <p> The check in the header looks like this: <code>#if defined(__GLIBCXX__) || defined(__GLIBCPP__)</code> </p> <p> However, clang++ also defines (at least one of) these macros but doesn't offer the gcc demangle API, so anything that uses this header will fail to compile on clang (like boost/exception/detail/type_info.hpp - The fact that this header includes a detail header from another library is, in my opinion, a bug in itself that should be fixed). </p> <p> I "fixed" this by changing the line into: <code>#if !defined(__clang__) &amp;&amp; (defined(__GLIBCXX__) || defined(__GLIBCPP__))</code> </p> <p> I think this isn't a real fix. boost should use something like configure checks to see if <code>abi::__cxa_demangle</code> is actually usable. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4763 Trac 1.4.3 anonymous Sat, 29 Jan 2011 21:03:31 GMT <link>https://svn.boost.org/trac10/ticket/4763#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4763#comment:1</guid> <description> <p> I just tried to compile <code>boost/units/detail/utility.hpp</code> with clang (trunk from monday) and no errors. I think the issue is not clang itself, but the C++ standard library used with it: I am using libstdc++ that came with gcc 4.2. </p> <p> But using another standard library does not mean that <code>abi::__cxa_demangle</code> (the function used by utility.hpp) does not exist, as that function is not gcc-specific, but part of the C++ ABI: <a class="ext-link" href="http://www.codesourcery.com/public/cxx-abi/abi.html#demangler"><span class="icon">​</span>http://www.codesourcery.com/public/cxx-abi/abi.html#demangler</a> </p> <p> <code>__cxa_demangle</code> is defined in the header file cxxabi.h. Perhaps at build-time, bjam should check for the existence of this header file. </p> </description> <category>Ticket</category> </item> <item> <author>Michel MORIN <mimomorin@…></author> <pubDate>Thu, 28 Jul 2011 07:57:56 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4763 https://svn.boost.org/trac10/ticket/4763 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">units_detail_utility.patch</span> </li> </ul> <p> A patch for boost/units/detail/utility.hpp (against trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/73307" title="- Corrected the conversion from double to e_float for efx::e_float. ...">r73307</a>). </p> Ticket Michel MORIN <mimomorin@…> Thu, 28 Jul 2011 08:00:47 GMT owner changed https://svn.boost.org/trac10/ticket/4763#comment:2 https://svn.boost.org/trac10/ticket/4763#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matthias Schabel</span> to <span class="trac-author">Steven Watanabe</span> </li> </ul> <p> Attached a patch that enables to use <code>abi::__cxa_demangle</code> in libc++ (though I don't fully understand the OP's problem). </p> Ticket Michel MORIN <mimomorin@…> Sun, 07 Aug 2011 06:17:16 GMT <link>https://svn.boost.org/trac10/ticket/4763#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4763#comment:3</guid> <description> <blockquote class="citation"> <p> Attached a patch that enables to use <code>abi::__cxa_demangle</code> in libc++ </p> </blockquote> <p> This is a wrong patch. libc++ does not provide <code>__cxa_demangle</code> (and <code>cxxabi.h</code>); it's <a class="ext-link" href="http://libcxxabi.llvm.org/"><span class="icon">​</span>libc++abi</a> that provides them. I withdraw the patch. </p> <p> In Mac OS X, to build libc++, libc++abi is needed (libc++abi is dynamically linked to libc++ and its symbols are re-exported). So using libc++ in Mac OS X implies that the functionality of libc++abi is also available. </p> <pre class="wiki">#if defined(__GLIBCXX__) || defined(__GLIBCPP__) || (defined(_LIBCPP_VERSION) &amp;&amp; defined(__APPLE__)) </pre><p> can detect this environment (and I locally use this code). </p> <p> Sorry for the noise. </p> </description> <category>Ticket</category> </item> <item> <author>Michel MORIN <mimomorin@…></author> <pubDate>Sat, 13 Aug 2011 15:05:18 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4763 https://svn.boost.org/trac10/ticket/4763 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">units_detail_utility.2.patch</span> </li> </ul> <p> A new patch for <code>boost/units/detail/utility.hpp</code>. This patch enables to detect &lt;cxxabi.h&gt; header file when compiling with clang. </p> Ticket Michel MORIN <mimomorin@…> Sat, 13 Aug 2011 15:11:32 GMT <link>https://svn.boost.org/trac10/ticket/4763#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4763#comment:4</guid> <description> <p> <a class="ticket" href="https://svn.boost.org/trac10/ticket/4763#comment:1" title="Comment 1">comment:1</a> </p> <blockquote class="citation"> <p> <code>__cxa_demangle</code> is defined in the header file cxxabi.h. Perhaps at build-time, bjam should check for the existence of this header file. </p> </blockquote> <p> I made a new patch along this line (but the check is done at the compile-time, not at the build-time). Clang has <code>__has_include</code> macro that can detect a specified header file. So this check can be done at the compile-time when compiling with clang. </p> <p> I tested the patch on gcc 4.3-4.6 and clang TOT (with libstdc++ and libc++) in both C++03 and C++0x modes. <code>boost::units::detail::demangle</code> works fine on them. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michel Morin</dc:creator> <pubDate>Sat, 07 Apr 2012 00:59:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4763#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4763#comment:5</guid> <description> <p> I created a new ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6773" title="#6773: Patches: Add cxxabi.h detection code for clang in boost/units/detail/utility.hpp (closed: fixed)">#6773</a> (with a cleaned up patch), since my patch does not try to resolve OP's request. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Wed, 11 Jun 2014 18:52:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4763#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4763#comment:6</guid> <description> <p> I believe the ticket can be closed as soon as <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/10116" title="#10116: Patches: Port to Boost.Core demangle() (closed: fixed)">#10116</a> is closed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jürgen Hunold</dc:creator> <pubDate>Wed, 05 Nov 2014 09:27:08 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/4763#comment:7 https://svn.boost.org/trac10/ticket/4763#comment:7 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Steven Watanabe</span> to <span class="trac-author">Jürgen Hunold</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Jürgen Hunold Wed, 05 Nov 2014 09:27:20 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/4763#comment:8 https://svn.boost.org/trac10/ticket/4763#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> Ticket