summaryrefslogtreecommitdiff
path: root/sw/source/core/layout
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-01 15:25:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-01 23:32:23 +0200
commit62808ef28e05eee4945a6a15d981350d1306b848 (patch)
treedc904c5e3e85c501f066d2acf3da06ec103dcbdf /sw/source/core/layout
parent463a79cbc16c1b4aba1775d7f8ae0324753c322c (diff)
external/boost: clang-cl cannot use MSVC's ATOMIC_FLAG_INIT
The C++ standard leaves it unspecified how ATOMIC_FLAG_INIT is defined, and at least MS Visual Studio 2017 version 15.9 defines it as {0}, asking for list- initialization, but std::atomic_flag is no aggregate (it has a default ctor) and has no suitable ctor for that initializer list. Other standard library implementations solve that by e.g. adding a std::atomic_flag ctor taking a bool parameter, and defining ATOMIC_FLAG_INIT as std::atomic_flag(false); but MSVC apparently relies on some non-standard behavior here that allows to initialize std::atomic_flag from {0}. But that is apparently not supported by clang-cl, causing failures like > [build CXX] workdir/UnpackedTarball/boost/libs/locale/src/shared/date_time.cpp > In file included from workdir/UnpackedTarball/boost/libs/locale/src/shared/date_time.cpp:11: > In file included from workdir/UnpackedTarball/boost\boost/thread/locks.hpp:10: > In file included from workdir/UnpackedTarball/boost\boost/thread/lock_algorithms.hpp:11: > In file included from workdir/UnpackedTarball/boost\boost/thread/lock_types.hpp:18: > In file included from workdir/UnpackedTarball/boost\boost/thread/thread_time.hpp:9: > In file included from workdir/UnpackedTarball/boost\boost/date_time/time_clock.hpp:17: > In file included from external/boost/include\boost/shared_ptr.hpp:27: > In file included from workdir/UnpackedTarball/boost\boost/shared_ptr.hpp:17: > In file included from workdir/UnpackedTarball/boost\boost/smart_ptr/shared_ptr.hpp:36: > workdir/UnpackedTarball/boost\boost/smart_ptr/detail/spinlock_pool.hpp(77,5): error: no matching constructor for initialization of 'std::atomic_flag' > BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, > ^~~~~~~~~~~~~~~~~~~~~~~~~~ > workdir/UnpackedTarball/boost\boost/smart_ptr/detail/spinlock_std_atomic.hpp(81,38): note: expanded from macro 'BOOST_DETAIL_SPINLOCK_INIT' > #define BOOST_DETAIL_SPINLOCK_INIT { ATOMIC_FLAG_INIT } > ^~~~~~~~~~~~~~~~ > C:/PROGRA~2/MIB055~1/2017/COMMUN~1/VC/Tools/MSVC/1416~1.270/Include\atomic(158,26): note: expanded from macro 'ATOMIC_FLAG_INIT' > #define ATOMIC_FLAG_INIT {0} > ^~~ > C:/PROGRA~2/MIB055~1/2017/COMMUN~1/VC/Tools/MSVC/1416~1.270/Include\atomic(169,2): note: candidate constructor not viable: no known conversion from 'int' to 'const std::atomic_flag' for 1st argument > atomic_flag(const atomic_flag&) = delete; > ^ > C:/PROGRA~2/MIB055~1/2017/COMMUN~1/VC/Tools/MSVC/1416~1.270/Include\atomic(168,2): note: candidate constructor not viable: requires 0 arguments, but 1 was provided > atomic_flag() noexcept = default; > ^ The internals of external/boost appear to be the only place where we currently use ATOMIC_FLAG_INIT, and we can work around that easily by picking a different backend in boost/smart_ptr/detail/spinlock.hpp for the problematic combination of Clang and _MSC_VER 1916 (which may need to be extended to further MSVC versions). Change-Id: Ie6aa62556efbedd3897ad7803b546cb8088ebe10 Reviewed-on: https://gerrit.libreoffice.org/79967 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/core/layout')
0 files changed, 0 insertions, 0 deletions