Subject: [Boost-bugs] [Boost C++ Libraries] #5635: compile error due to __is_pod conflicts with clang 3.x on osx 10.6
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-06-23 22:41:58
#5635: compile error due to __is_pod conflicts with clang 3.x on osx 10.6
------------------------------------------------+---------------------------
Reporter: Dane Springmeyer <dane@â¦> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_traits
Version: Boost Development Trunk | Severity: Showstopper
Keywords: |
------------------------------------------------+---------------------------
Boost trunk no longer compiles with clang trunk on my system (mac osx
10.6) if a header like `boost/iterator/iterator_facade.hpp` or
`boost/filesystem/operations.hpp` is included that leverages
`type_traits/is_pod.hpp`.
A simple test case is:
`clang++ -o test.o -c -I/opt/boost-trunk/include test.cpp`
{{{
#include <boost/iterator/iterator_facade.hpp>
int main() {
return 0;
}
}}}
This results in:
{{{
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< ::boost::is_scalar<T>::value,
::boost::is_void<T>::value, __is_pod(T) >::value);
^
/opt/boost-trunk/include/boost/type_traits/is_pod.hpp:38:20: note:
declared here
template <typename T> 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< ::boost::is_scalar<T>::value,
::boost::is_void<T>::value, __is_pod(T) >::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< ::boost::is_scalar<T>::value,
::boost::is_void<T>::value, __is_pod(T) >::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<
::boost::is_scalar<T>::value, ...
^
4 errors generated.
}}}
See also: http://dbsgeo.com/tmp/clang-boost-error.ii
I am seeing this with boost trunk svn r72721 and clang trunk:
{{{
$ clang -v
clang version 3.0 (trunk 131789)
Target: x86_64-apple-darwin10.7.0
Thread model: posix
}}}
Developers on the #llvm irc.oftc.net channel helped advise that the reason
is likely conflicting __is_pod definitions. To quote the details:
{{{
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 <4.4 defined an __is_pod struct in libstdc++ and
gcc>=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
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5635> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC