Opened 7 years ago
Last modified 7 years ago
#11280 new Bugs
VS 2010 with LLVM
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | To Be Determined | Component: | smart_ptr |
Version: | Boost 1.58.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I can't compile anything that includes BOOST when I use as a compiler clang on MSVC 2010/2013. The error is a compiler error and not a linker error. I already built BOOST for CLANG on windows, but I didn't get to the linking stage.
Here is the error log:
1>------ Build started: Project: llvmTest, Configuration: Debug LLVM Win32 ------
1> In file included from Source.cpp:1:
1> In file included from c:\Boost\include\boost-1_58\boost/thread.hpp:13:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread.hpp:12:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread_only.hpp:15:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/win32/thread_data.hpp:10:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread_time.hpp:9:
1> In file included from c:\Boost\include\boost-1_58\boost/date_time/time_clock.hpp:17:
1> In file included from c:\Boost\include\boost-1_58\boost/shared_ptr.hpp:17:
1> In file included from c:\Boost\include\boost-1_58\boost/smart_ptr/shared_ptr.hpp:28:
1> In file included from c:\Boost\include\boost-1_58\boost/smart_ptr/detail/shared_count.hpp:29:
1> In file included from c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base.hpp:45:
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(27,8): error : unknown type name '_Atomic'
1> typedef _Atomic( boost::int_least32_t ) atomic_int_least32_t;
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(27,24): error : cannot define or redeclare 'int_least32_t' here because namespace 'detail' does not enclose namespace 'boost'
1> typedef _Atomic( boost::int_least32_t ) atomic_int_least32_t;
1> ~
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(27,24): error : typedef declarator cannot be qualified
1> typedef _Atomic( boost::int_least32_t ) atomic_int_least32_t;
1> ~
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(27,39): error : expected ';' after top level declarator
1> typedef _Atomic( boost::int_least32_t ) atomic_int_least32_t;
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(29,30): error : unknown type name 'atomic_int_least32_t'
1> inline void atomic_increment( atomic_int_least32_t * pw )
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(34,46): error : unknown type name 'atomic_int_least32_t'
1> inline boost::int_least32_t atomic_decrement( atomic_int_least32_t * pw )
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(39,58): error : unknown type name 'atomic_int_least32_t'
1> inline boost::int_least32_t atomic_conditional_increment( atomic_int_least32_t * pw )
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(68,4): error : unknown type name 'atomic_int_least32_t'
1> atomic_int_least32_t use_count_; #shared
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(69,4): error : unknown type name 'atomic_int_least32_t'
1> atomic_int_least32_t weak_count_; #weak + (#shared != 0)
1>
1>c:\Boost\include\boost-1_58\boost/smart_ptr/detail/sp_counted_base_clang.hpp(132,46): error : unknown type name 'atomic_int_least32_t'
1> return c11_atomic_load( const_cast< atomic_int_least32_t* >( &use_count_ ), ATOMIC_ACQUIRE );
1>
1> In file included from Source.cpp:1:
1> In file included from c:\Boost\include\boost-1_58\boost/thread.hpp:13:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread.hpp:12:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread_only.hpp:15:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/win32/thread_data.hpp:11:
1>c:\Boost\include\boost-1_58\boost/thread/win32/thread_primitives.hpp(183,53): error : redeclaration of 'Sleep' cannot add 'dllimport' attribute
1> declspec(dllimport) void stdcall Sleep(unsigned long);
1>
1> c:\Boost\include\boost-1_58\boost/smart_ptr/detail/yield_k.hpp(63,28) : note: previous declaration is here
1> extern "C" void stdcall Sleep( unsigned long ms );
1>
1> In file included from Source.cpp:1:
1> In file included from c:\Boost\include\boost-1_58\boost/thread.hpp:13:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread.hpp:12:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread_only.hpp:15:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/win32/thread_data.hpp:11:
1>c:\Boost\include\boost-1_58\boost/thread/win32/thread_primitives.hpp(418,20): error : no member named 'Sleep' in namespace 'boost::detail::win32'; did you mean simply 'Sleep'?
1> ::boost::detail::win32::Sleep(0);
1> ~
1> c:\Boost\include\boost-1_58\boost/smart_ptr/detail/yield_k.hpp(63,28) : note: 'Sleep' declared here
1> extern "C" void stdcall Sleep( unsigned long ms );
1>
1> In file included from Source.cpp:1:
1> In file included from c:\Boost\include\boost-1_58\boost/thread.hpp:13:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread.hpp:12:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/thread_only.hpp:15:
1> In file included from c:\Boost\include\boost-1_58\boost/thread/win32/thread_data.hpp:11:
1>c:\Boost\include\boost-1_58\boost/thread/win32/thread_primitives.hpp(426,44): error : no type named 'Sleep' in namespace 'boost::detail::win32'
1> ::boost::detail::win32::Sleep(milliseconds);
1>
1> 13 errors generated.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Change History (2)
comment:1 by , 7 years ago
Component: | None → smart_ptr |
---|---|
Owner: | set to |
sp_counted_base_clang.hpp
is included when__has_extension( __c_atomic__ )
, which should mean that the C11 keyword_Atomic
is available. This does seem to be the case for Clang on other platforms. You might want to inquire about this in aclang-cl
specific forum.