Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P0619R4 Removing C++17-Deprecated Features #380

Merged
merged 12 commits into from
Feb 3, 2020
2 changes: 1 addition & 1 deletion llvm-project
Submodule llvm-project updated 4469 files
4 changes: 2 additions & 2 deletions stl/inc/bitset
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_
// STRUCT TEMPLATE SPECIALIZATION hash
template <size_t _Bits>
struct hash<bitset<_Bits>> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bitset<_Bits> argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bitset<_Bits> _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t _RESULT_TYPE_NAME;

_NODISCARD size_t operator()(const bitset<_Bits>& _Keyval) const noexcept {
return _Hash_representation(_Keyval._Array);
Expand Down
2 changes: 2 additions & 0 deletions stl/inc/exception
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ _STL_DISABLE_CLANG_WARNINGS

_STD_BEGIN

#if _HAS_DEPRECATED_UNCAUGHT_EXCEPTION
_CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL uncaught_exception() noexcept;
#endif // _HAS_DEPRECATED_UNCAUGHT_EXCEPTION
_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions() noexcept;

_STD_END
Expand Down
58 changes: 30 additions & 28 deletions stl/inc/functional
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ _STD_BEGIN
// STRUCT TEMPLATE divides
template <class _Ty = void>
struct divides {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left / _Right;
Expand All @@ -50,9 +50,9 @@ struct divides {
// STRUCT TEMPLATE modulus
template <class _Ty = void>
struct modulus {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left % _Right;
Expand All @@ -62,8 +62,8 @@ struct modulus {
// STRUCT TEMPLATE negate
template <class _Ty = void>
struct negate {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left) const {
return -_Left;
Expand Down Expand Up @@ -91,9 +91,9 @@ struct negate {
// STRUCT TEMPLATE logical_and
template <class _Ty = void>
struct logical_and {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool _RESULT_TYPE_NAME;

constexpr bool operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left && _Right;
Expand All @@ -103,9 +103,9 @@ struct logical_and {
// STRUCT TEMPLATE logical_or
template <class _Ty = void>
struct logical_or {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool _RESULT_TYPE_NAME;

constexpr bool operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left || _Right;
Expand All @@ -115,8 +115,8 @@ struct logical_or {
// STRUCT TEMPLATE logical_not
template <class _Ty = void>
struct logical_not {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool _RESULT_TYPE_NAME;

constexpr bool operator()(const _Ty& _Left) const {
return !_Left;
Expand All @@ -126,9 +126,9 @@ struct logical_not {
// STRUCT TEMPLATE bit_and
template <class _Ty = void>
struct bit_and {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left & _Right;
Expand All @@ -138,9 +138,9 @@ struct bit_and {
// STRUCT TEMPLATE bit_or
template <class _Ty = void>
struct bit_or {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left | _Right;
Expand All @@ -150,9 +150,9 @@ struct bit_or {
// STRUCT TEMPLATE bit_xor
template <class _Ty = void>
struct bit_xor {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left, const _Ty& _Right) const {
return _Left ^ _Right;
Expand All @@ -162,8 +162,8 @@ struct bit_xor {
// STRUCT TEMPLATE bit_not
template <class _Ty = void>
struct bit_not {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _RESULT_TYPE_NAME;

constexpr _Ty operator()(const _Ty& _Left) const {
return ~_Left;
Expand Down Expand Up @@ -314,6 +314,7 @@ struct bit_not<void> {
}
};

#if _HAS_DEPRECATED_NEGATORS
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE unary_negate
template <class _Fn>
Expand Down Expand Up @@ -362,6 +363,7 @@ _CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr binary_negate<_Fn> not2(const _Fn
return binary_negate<_Fn>(_Func);
}
_STL_RESTORE_DEPRECATED_WARNING
#endif // _HAS_DEPRECATED_NEGATORS

#if _HAS_AUTO_PTR_ETC
_STL_DISABLE_DEPRECATED_WARNING
Expand Down Expand Up @@ -1428,7 +1430,7 @@ auto _Call_binder(_Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_FD& _Obj, _Cv_
// CLASS TEMPLATE _Binder
template <class _Ret>
struct _Forced_result_type { // used by bind<R>()
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ret result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ret _RESULT_TYPE_NAME;
};

template <class _Ret, class _Fx>
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/map
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ public:

class value_compare {
public:
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef value_type first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef value_type second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef value_type _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef value_type _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool _RESULT_TYPE_NAME;

_NODISCARD bool operator()(const value_type& _Left, const value_type& _Right) const {
// test if _Left precedes _Right by comparing just keys
Expand Down
20 changes: 12 additions & 8 deletions stl/inc/memory
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff
#endif // _HAS_CXX17


#if _HAS_DEPRECATED_RAW_STORAGE_ITERATOR
// CLASS TEMPLATE raw_storage_iterator
template <class _OutIt, class _Ty>
class _CXX17_DEPRECATE_RAW_STORAGE_ITERATOR raw_storage_iterator { // wrap stores to raw buffer as output iterator
Expand Down Expand Up @@ -462,6 +463,7 @@ public:
private:
_OutIt _Next;
};
#endif // _HAS_DEPRECATED_RAW_STORAGE_ITERATOR


#if _HAS_AUTO_PTR_ETC
Expand Down Expand Up @@ -1205,10 +1207,12 @@ public:
return get()[_Idx];
}

#if _HAS_DEPRECATED_SHARED_PTR_UNIQUE
_CXX17_DEPRECATE_SHARED_PTR_UNIQUE _NODISCARD bool unique() const noexcept {
// return true if no other shared_ptr object owns this resource
return this->use_count() == 1;
}
#endif // _HAS_DEPRECATED_SHARED_PTR_UNIQUE

explicit operator bool() const noexcept {
return get() != nullptr;
Expand Down Expand Up @@ -2211,9 +2215,9 @@ struct owner_less; // not defined

template <class _Ty>
struct owner_less<shared_ptr<_Ty>> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef shared_ptr<_Ty> first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef shared_ptr<_Ty> second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef shared_ptr<_Ty> _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef shared_ptr<_Ty> _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool _RESULT_TYPE_NAME;

_NODISCARD bool operator()(const shared_ptr<_Ty>& _Left, const shared_ptr<_Ty>& _Right) const noexcept {
return _Left.owner_before(_Right);
Expand All @@ -2230,9 +2234,9 @@ struct owner_less<shared_ptr<_Ty>> {

template <class _Ty>
struct owner_less<weak_ptr<_Ty>> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef weak_ptr<_Ty> first_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef weak_ptr<_Ty> second_argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef weak_ptr<_Ty> _FIRST_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef weak_ptr<_Ty> _SECOND_ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bool _RESULT_TYPE_NAME;

_NODISCARD bool operator()(const weak_ptr<_Ty>& _Left, const weak_ptr<_Ty>& _Right) const noexcept {
return _Left.owner_before(_Right);
Expand Down Expand Up @@ -2284,8 +2288,8 @@ struct hash<unique_ptr<_Ty, _Dx>> : _Conditionally_enabled_hash<unique_ptr<_Ty,

template <class _Ty>
struct hash<shared_ptr<_Ty>> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef shared_ptr<_Ty> argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef shared_ptr<_Ty> _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t _RESULT_TYPE_NAME;

_NODISCARD size_t operator()(const shared_ptr<_Ty>& _Keyval) const noexcept {
return hash<typename shared_ptr<_Ty>::element_type*>()(_Keyval.get());
Expand Down
14 changes: 9 additions & 5 deletions stl/inc/ostream
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,17 @@ public:

_STL_DISABLE_DEPRECATED_WARNING
__CLR_OR_THIS_CALL ~sentry() noexcept {
#if _HAS_EXCEPTIONS
if (!_STD uncaught_exception()) { // TRANSITION, ArchivedOS-12000909
#if !_HAS_EXCEPTIONS
const bool _Zero_uncaught_exceptions = true;
#elif _HAS_DEPRECATED_UNCAUGHT_EXCEPTION
const bool _Zero_uncaught_exceptions = !_STD uncaught_exception(); // TRANSITION, ArchivedOS-12000909
#else // ^^^ _HAS_DEPRECATED_UNCAUGHT_EXCEPTION / !_HAS_DEPRECATED_UNCAUGHT_EXCEPTION vvv
const bool _Zero_uncaught_exceptions = _STD uncaught_exceptions() == 0;
#endif // !_HAS_DEPRECATED_UNCAUGHT_EXCEPTION

if (_Zero_uncaught_exceptions) {
this->_Myostr._Osfx();
}
#else // _HAS_EXCEPTIONS
this->_Myostr._Osfx();
#endif // _HAS_EXCEPTIONS
}
_STL_RESTORE_DEPRECATED_WARNING

Expand Down
8 changes: 4 additions & 4 deletions stl/inc/system_error
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ _NODISCARD inline error_condition make_error_condition(io_errc _Errno) noexcept
// STRUCT TEMPLATE SPECIALIZATION hash
template <>
struct hash<error_code> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef error_code argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef error_code _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t _RESULT_TYPE_NAME;

_NODISCARD size_t operator()(const error_code& _Keyval) const noexcept {
return hash<int>{}(_Keyval.value());
Expand All @@ -366,8 +366,8 @@ struct hash<error_code> {

template <>
struct hash<error_condition> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef error_condition argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef error_condition _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t _RESULT_TYPE_NAME;

_NODISCARD size_t operator()(const error_condition& _Keyval) const noexcept {
return hash<int>{}(_Keyval.value());
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/thread
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ basic_ostream<_Ch, _Tr>& operator<<(basic_ostream<_Ch, _Tr>& _Str, thread::id _I
// STRUCT TEMPLATE SPECIALIZATION hash
template <>
struct hash<thread::id> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef thread::id argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t result_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef thread::id _ARGUMENT_TYPE_NAME;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t _RESULT_TYPE_NAME;

_NODISCARD size_t operator()(const thread::id _Keyval) const noexcept {
return _Hash_representation(_Keyval._Id);
Expand Down
Loading