Files
libcxx/test/std/utilities/memory/util.dynamic.safety/get_pointer_safety.pass.cpp
Eric Fiselier c3dfeced41 Fix PR26961 - Add default constructor to std::pointer_safety struct.
In ABI v1 libc++ implements std::pointer_safety as a class type instead
of an enumeration. However this class type does not provide
a default constructor as it should. This patch adds that default constructor.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 01:28:40 +00:00

38 lines
855 B
C++

//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <memory>
// pointer_safety get_pointer_safety();
// UNSUPPORTED: c++98, c++03
#include <memory>
#include <cassert>
void test_pr26961() {
std::pointer_safety d;
d = std::get_pointer_safety();
assert(d == std::get_pointer_safety());
}
int main()
{
{
std::pointer_safety r = std::get_pointer_safety();
assert(r == std::pointer_safety::relaxed ||
r == std::pointer_safety::preferred ||
r == std::pointer_safety::strict);
}
{
test_pr26961();
}
}