mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 19:07:53 +08:00
[libcxx] Fix deprecation warning by suppressing deprecated around
__test_has_construct.
In C++17 some tests started failing after a521532aa1. This fixes those errors by suppressing the deprecation warning when calling `construct` in `__test_has_construct`. This is the same solution as `__has_destroy_test` already uses.
Reviewers: ldionne, #libc!
Subscribers: dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D80481
This commit is contained in:
@@ -1352,9 +1352,12 @@ struct __has_allocate_hint
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
template <class _Alloc, class ..._Args,
|
||||
class = decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Args>()...))>
|
||||
static true_type __test_has_construct(int);
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
template <class _Alloc, class...>
|
||||
static false_type __test_has_construct(...);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user