mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-22 16:37:40 +08:00

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
38 lines
855 B
C++
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();
|
|
}
|
|
}
|