diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h --- a/libcxx/include/__utility/pair.h +++ b/libcxx/include/__utility/pair.h @@ -49,12 +49,8 @@ _T1 first; _T2 second; -#if !defined(_LIBCPP_CXX03_LANG) pair(pair const&) = default; pair(pair&&) = default; -#else - // Use the implicitly declared copy constructor in C++03 -#endif #ifdef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY @@ -421,8 +417,6 @@ __x.swap(__y); } -#ifndef _LIBCPP_CXX03_LANG - template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 pair::type, typename __unwrap_ref_decay<_T2>::type> @@ -432,18 +426,6 @@ (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2)); } -#else // _LIBCPP_CXX03_LANG - -template -inline _LIBCPP_INLINE_VISIBILITY -pair<_T1,_T2> -make_pair(_T1 __x, _T2 __y) -{ - return pair<_T1, _T2>(__x, __y); -} - -#endif // _LIBCPP_CXX03_LANG - template struct _LIBCPP_TEMPLATE_VIS tuple_size > : public integral_constant {}; @@ -483,7 +465,6 @@ const _T1& get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;} -#ifndef _LIBCPP_CXX03_LANG template static _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 @@ -495,7 +476,6 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T1&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward(__p.first);} -#endif // _LIBCPP_CXX03_LANG }; template <> @@ -513,7 +493,6 @@ const _T2& get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;} -#ifndef _LIBCPP_CXX03_LANG template static _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 @@ -525,7 +504,6 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 const _T2&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward(__p.second);} -#endif // _LIBCPP_CXX03_LANG }; template @@ -544,7 +522,6 @@ return __get_pair<_Ip>::get(__p); } -#ifndef _LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&& @@ -560,7 +537,6 @@ { return __get_pair<_Ip>::get(_VSTD::move(__p)); } -#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 11 template @@ -619,7 +595,7 @@ return __get_pair<1>::get(_VSTD::move(__p)); } -#endif +#endif // _LIBCPP_STD_VER > 11 _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pair.astuple/get_const_rv.pass.cpp @@ -14,7 +14,7 @@ // const typename tuple_element >::type&& // get(const pair&&); -// UNSUPPORTED: c++03 +// UNSUPPORTED: c++03 && !stdlib=libc++ #include #include @@ -26,12 +26,14 @@ int main(int, char**) { { +#if TEST_STD_VER >= 11 typedef std::pair, short> P; const P p(std::unique_ptr(new int(3)), static_cast(4)); static_assert(std::is_same&&, decltype(std::get<0>(std::move(p)))>::value, ""); static_assert(noexcept(std::get<0>(std::move(p))), ""); const std::unique_ptr&& ptr = std::get<0>(std::move(p)); assert(*ptr == 3); +#endif } { @@ -39,12 +41,15 @@ int const y = 43; std::pair const p(x, y); static_assert(std::is_same(std::move(p)))>::value, ""); - static_assert(noexcept(std::get<0>(std::move(p))), ""); static_assert(std::is_same(std::move(p)))>::value, ""); +#if TEST_STD_VER >= 11 + static_assert(noexcept(std::get<0>(std::move(p))), ""); static_assert(noexcept(std::get<1>(std::move(p))), ""); +#endif } { +#if TEST_STD_VER >= 11 int x = 42; int const y = 43; std::pair const p(std::move(x), std::move(y)); @@ -52,6 +57,7 @@ static_assert(noexcept(std::get<0>(std::move(p))), ""); static_assert(std::is_same(std::move(p)))>::value, ""); static_assert(noexcept(std::get<1>(std::move(p))), ""); +#endif } #if TEST_STD_VER > 11 diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp @@ -1,9 +1,8 @@ //===----------------------------------------------------------------------===// // -// 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. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp @@ -1,9 +1,8 @@ //===----------------------------------------------------------------------===// // -// 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. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp --- a/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp @@ -1,9 +1,8 @@ //===----------------------------------------------------------------------===// // -// 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. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===//