Boost C++ Libraries: Ticket #5635: compile error due to __is_pod conflicts with clang 3.x on osx 10.6 https://svn.boost.org/trac10/ticket/5635 <p> Boost trunk no longer compiles with clang trunk on my system (mac osx 10.6) if a header like <code>boost/iterator/iterator_facade.hpp</code> or <code>boost/filesystem/operations.hpp</code> is included that leverages <code>type_traits/is_pod.hpp</code>. </p> <p> A simple test case is: </p> <p> <code>clang++ -o test.o -c -I/opt/boost-trunk/include test.cpp</code> </p> <pre class="wiki">#include &lt;boost/iterator/iterator_facade.hpp&gt; int main() { return 0; } </pre><p> This results in: </p> <pre class="wiki">In file included from test.cpp:1: In file included from test.cpp:1: In file included from /opt/boost-trunk/include/boost/iterator/iterator_facade.hpp:26: /opt/boost-trunk/include/boost/type_traits/is_pod.hpp:40:129: error: 'T' does not refer to a value ...= (::boost::type_traits::ice_or&lt; ::boost::is_scalar&lt;T&gt;::value, ::boost::is_void&lt;T&gt;::value, __is_pod(T) &gt;::value); ^ /opt/boost-trunk/include/boost/type_traits/is_pod.hpp:38:20: note: declared here template &lt;typename T&gt; struct is_pod_impl ^ /opt/boost-trunk/include/boost/type_traits/is_pod.hpp:40:141: error: type name requires a specifier or qualifier ...= (::boost::type_traits::ice_or&lt; ::boost::is_scalar&lt;T&gt;::value, ::boost::is_void&lt;T&gt;::value, __is_pod(T) &gt;::value); ^ /opt/boost-trunk/include/boost/type_traits/is_pod.hpp:40:141: error: C++ requires a type specifier for all declarations ...= (::boost::type_traits::ice_or&lt; ::boost::is_scalar&lt;T&gt;::value, ::boost::is_void&lt;T&gt;::value, __is_pod(T) &gt;::value); ^ /opt/boost-trunk/include/boost/type_traits/is_pod.hpp:40:141: error: expected ')' /opt/boost-trunk/include/boost/type_traits/is_pod.hpp:40:31: note: to match this '(' static const bool value = (::boost::type_traits::ice_or&lt; ::boost::is_scalar&lt;T&gt;::value, ... ^ 4 errors generated. </pre><p> See also: <a class="ext-link" href="http://dbsgeo.com/tmp/clang-boost-error.ii"><span class="icon">​</span>http://dbsgeo.com/tmp/clang-boost-error.ii</a> </p> <p> I am seeing this with boost trunk svn <a class="changeset" href="https://svn.boost.org/trac10/changeset/72721" title="sync projects">r72721</a> and clang trunk: </p> <pre class="wiki">$ clang -v clang version 3.0 (trunk 131789) Target: x86_64-apple-darwin10.7.0 Thread model: posix </pre><p> Developers on the #llvm irc.oftc.net channel helped advise that the reason is likely conflicting <span class="underline">is_pod definitions. To quote the details: </span></p> <pre class="wiki">there's a horrible compatibility hack in clang to cope with gcc's treatment of __is_pod basically, __is_pod is a compiler intrinsic, unless it's defined as an identifier, at which point it loses its magic this is because gcc &lt;4.4 defined an __is_pod struct in libstdc++ and gcc&gt;=4.4 define an __is_pod intrinsic (iirc) type_traits/intrinsics.hpp is using __is_pod as the definition of BOOST_IS_POD, which would be fine, except that your translation unit also pulls in libstdc++ 4.2.1's bits/cpp_type_traits.h, which defines __is_pod </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5635 Trac 1.4.3 anonymous Fri, 24 Jun 2011 10:00:06 GMT severity changed https://svn.boost.org/trac10/ticket/5635#comment:1 https://svn.boost.org/trac10/ticket/5635#comment:1 <ul> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Regression</span> </li> </ul> <p> Use of clang intrinsics was reverted on trunk in <a class="changeset" href="https://svn.boost.org/trac10/changeset/72725" title="Revert support for clang 3.0 intrinsics in type traits. As dicussed ...">r72725</a>, that should be included in the final release. </p> <p> Downgrading the severity since this is a problem with an unreleased compiler. </p> Ticket Dane Springmeyer <dane@…> Fri, 24 Jun 2011 18:08:38 GMT <link>https://svn.boost.org/trac10/ticket/5635#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5635#comment:2</guid> <description> <p> great. thanks, that appears to fix things. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sun, 26 Jun 2011 08:16:59 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5635#comment:3 https://svn.boost.org/trac10/ticket/5635#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/72758" title="Revert Clang intrinsics support - it doesn't always work presently. ...">[72758]</a>) Revert Clang intrinsics support - it doesn't always work presently. Change authorized by eric niebler. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5635" title="#5635: Bugs: compile error due to __is_pod conflicts with clang 3.x on osx 10.6 (closed: fixed)">#5635</a>. </p> Ticket