-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cpp11: clang doesn't allow mutex_t to be used with constexpr #4583
Copy link
Copy link
Closed
Labels
Area: C++Area: C++ wrapperArea: C++ wrapperOS: Mac OS XHost OS: This PR/issue concerns usage of RIOT with Mac OS X as a host systemHost OS: This PR/issue concerns usage of RIOT with Mac OS X as a host system
Milestone
Description
All cpp11-* tests fail for OS X with clang with the following errors.
In file included from RIOT/tests/cpp11_condition_variable/main.cpp:26:
RIOT/sys/cpp11-compat/include/riot/mutex.hpp:47:45: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
inline constexpr mutex() noexcept : m_mtx{0, PRIORITY_QUEUE_INIT} {}
^
{}
RIOT/sys/cpp11-compat/include/riot/mutex.hpp:47:20: error: constexpr constructor never produces a constant expression
[-Winvalid-constexpr]
inline constexpr mutex() noexcept : m_mtx{0, PRIORITY_QUEUE_INIT} {}
^
RIOT/sys/cpp11-compat/include/riot/mutex.hpp:47:44: note: non-literal type 'mutex_t' cannot be used in a constant expression
inline constexpr mutex() noexcept : m_mtx{0, PRIORITY_QUEUE_INIT} {}Compiled with
% clang -v
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin15.2.0
Thread model: posixReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: C++Area: C++ wrapperArea: C++ wrapperOS: Mac OS XHost OS: This PR/issue concerns usage of RIOT with Mac OS X as a host systemHost OS: This PR/issue concerns usage of RIOT with Mac OS X as a host system