Implement LWG 2773 - std::ignore should be constexpr.

In addition to the PR for LWG 2773 this patch also ensures
that each of std::ignores constructors or assignment operators
are constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294165 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-02-06 01:25:31 +00:00
parent fdbd18ff71
commit 07d23d5d93
4 changed files with 83 additions and 4 deletions

View File

@@ -1064,11 +1064,13 @@ template <class _Up>
struct __ignore_t
{
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
const __ignore_t& operator=(_Tp&&) const {return *this;}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const __ignore_t& operator=(_Tp&&) const {return *this;}
};
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
namespace {
constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>();
}
template <class _Tp>
struct __make_tuple_return_impl