The C++11 standard defines pointer_safety as: enum class pointer_safety { relaxed, preferred, strict }; But, currently pointer_safety is implemented as a struct. This causes that the following test to fail, because it is initialized by a constructor that takes an int: #include <memory> int main() { std::pointer_safety d ; d = std::get_pointer_safety(); return 0; } test.cpp:5:25: error: no matching constructor for initialization of 'std::pointer_safety' std::pointer_safety d ; ^ /usr/include/c++/v1/memory:5406:5: note: candidate constructor not viable: requires single argument '__v', but no arguments were provided pointer_safety(__lx __v) : __v_(__v) {} ^ /usr/include/c++/v1/memory:5394:25: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided struct _LIBCPP_TYPE_VIS pointer_safety ^ /usr/include/c++/v1/memory:5394:25: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided 1 error generated.
http://clang.llvm.org/cxx_status.html Minimal support for garbage collection and reachability-based leak detection N2670 N/A (2) it is not implemented in clang for reasons stated there.
So libc++ clearly implemented this incorrectly. My guess is that it was done before compilers supported enum classes. Changing from using a struct to using an enum class is ABI breaking for users and for the dylib which exports std::get_pointer_safety. Fixing this will probably be a pretty low priority.
Alright. Fixed in v4.0 by r291059 and r291046. The two relevant changes are: 1) libc++ now implements std::pointer_safety as an enum type in ABI v2. 2) The fallback struct type now provides a default constructor.