Fix rvalue bug in __has_operator_addressof

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@221398 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2014-11-05 21:20:10 +00:00
parent 341b59021c
commit b6e0ef2deb
2 changed files with 24 additions and 11 deletions

View File

@@ -41,9 +41,19 @@ struct E
};
struct F {};
constexpr F* operator&(F const &) { return nullptr; }
struct G {};
constexpr G* operator&(G &&) { return nullptr; }
struct H {};
constexpr H* operator&(H const &&) { return nullptr; }
struct J
{
constexpr J* operator&() &&;
};
#endif // _LIBCPP_HAS_NO_CONSTEXPR
int main()
@@ -54,5 +64,8 @@ int main()
static_assert(std::__has_operator_addressof<B>::value == true, "");
static_assert(std::__has_operator_addressof<E>::value == true, "");
static_assert(std::__has_operator_addressof<F>::value == true, "");
static_assert(std::__has_operator_addressof<G>::value == true, "");
static_assert(std::__has_operator_addressof<H>::value == true, "");
static_assert(std::__has_operator_addressof<J>::value == true, "");
#endif // _LIBCPP_HAS_NO_CONSTEXPR
}