1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# clang-cl supports constexpr, so BOOST_CHRONO_LIB_CONSTEXPR expands to
# "constexpr", but MSVC's std::numeric_limits<>::max() isn't marked as
# constexpr, so clang-cl issues -Winvalid-constexpr:
--- boost/chrono/duration.hpp
+++ boost/chrono/duration.hpp
@@ -348,29 +348,36 @@
static BOOST_CHRONO_LIB_CONSTEXPR T lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW {return (std::numeric_limits<T>::min) ();}
};
+#if defined _MSC_VER && defined __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Winvalid-constexpr"
+#endif
template <>
struct chrono_numeric_limits<float,true> {
static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
{
return -(std::numeric_limits<float>::max) ();
}
};
template <>
struct chrono_numeric_limits<double,true> {
static BOOST_CHRONO_LIB_CONSTEXPR double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
{
return -(std::numeric_limits<double>::max) ();
}
};
template <>
struct chrono_numeric_limits<long double,true> {
static BOOST_CHRONO_LIB_CONSTEXPR long double lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW
{
return -(std::numeric_limits<long double>::max)();
}
};
+#if defined _MSC_VER && defined __clang__
+#pragma clang diagnostic pop
+#endif
template <class T>
struct numeric_limits : chrono_numeric_limits<typename remove_cv<T>::type>
--- boost/config/compiler/clang.hpp
+++ boost/config/compiler/clang.hpp
@@ -260,9 +260,7 @@
// Unused attribute:
-#if defined(__GNUC__) && (__GNUC__ >= 4)
# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
-#endif
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "Clang version " __clang_version__
# workdir/UnpackedTarball/boost\boost/smart_ptr/detail/sp_counted_base_clang.hpp(29,1) : error: cannot mangle this C11 atomic type yet
# inline void atomic_increment( atomic_int_least32_t * pw )
# ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- boost/smart_ptr/detail/sp_counted_base.hpp
+++ boost/smart_ptr/detail/sp_counted_base.hpp
@@ -21,7 +21,7 @@
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
#if defined( __clang__ ) && defined( __has_extension )
-# if __has_extension( __c_atomic__ )
+# if __has_extension( __c_atomic__ ) && !defined _MSC_VER
# define BOOST_SP_HAS_CLANG_C11_ATOMICS
# endif
#endif
# C:/lo64/core/workdir/UnpackedTarball/boost/libs/thread/src/win32/thread.cpp(1006,36) : error: dllimport cannot be applied to non-inline function definition
# BOOST_THREAD_DECL void __cdecl on_process_enter()
# ^
--- boost/thread/detail/config.hpp
+++ boost/thread/detail/config.hpp
@@ -396,7 +396,7 @@
#else //Use default
# if defined(BOOST_THREAD_PLATFORM_WIN32)
# if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN) \
- || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32)
+ || defined(__MINGW32__) || defined(MINGW32) || defined(BOOST_MINGW32) || defined __clang__
//For compilers supporting auto-tss cleanup
//with Boost.Threads lib, use Boost.Threads lib
# define BOOST_THREAD_USE_LIB
|