summaryrefslogtreecommitdiffstats
path: root/libcxx/include/memory
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-03-20 23:02:53 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-03-20 23:02:53 +0000
commite0742c4abf1a3c4aa23586233df895fe8fbcbb00 (patch)
tree41cb614cf452b318417f82c0e54699244803b85a /libcxx/include/memory
parent37a1a29fcb434f22f79be2d3d403edb9d0b879da (diff)
downloadbcm5719-llvm-e0742c4abf1a3c4aa23586233df895fe8fbcbb00.tar.gz
bcm5719-llvm-e0742c4abf1a3c4aa23586233df895fe8fbcbb00.zip
Implement LWG3035: std::allocator's constructors should be constexpr.
llvm-svn: 328059
Diffstat (limited to 'libcxx/include/memory')
-rw-r--r--libcxx/include/memory25
1 files changed, 18 insertions, 7 deletions
diff --git a/libcxx/include/memory b/libcxx/include/memory
index bc5c4c65383..ea52ba2cb64 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -126,9 +126,10 @@ public:
template <class U> struct rebind {typedef allocator<U> other;};
- allocator() noexcept;
- allocator(const allocator&) noexcept;
- template <class U> allocator(const allocator<U>&) noexcept;
+ constexpr allocator() noexcept; // constexpr in C++20
+ constexpr allocator(const allocator&) noexcept; // constexpr in C++20
+ template <class U>
+ constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20
~allocator();
pointer address(reference x) const noexcept;
const_pointer address(const_reference x) const noexcept;
@@ -1778,8 +1779,13 @@ public:
template <class _Up> struct rebind {typedef allocator<_Up> other;};
- _LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator() _NOEXCEPT {}
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator(const allocator<_Up>&) _NOEXCEPT {}
+
_LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const _NOEXCEPT
{return _VSTD::addressof(__x);}
_LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
@@ -1877,8 +1883,13 @@ public:
template <class _Up> struct rebind {typedef allocator<_Up> other;};
- _LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator() _NOEXCEPT {}
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
+ allocator(const allocator<_Up>&) _NOEXCEPT {}
+
_LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
{return _VSTD::addressof(__x);}
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
OpenPOWER on IntegriCloud