[libcxx-commits] [PATCH] D80481: [libcxx] Fix deprecation warning by suppressing deprecated around __test_has_construct

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 23 14:51:20 PDT 2020


zoecarver created this revision.
zoecarver added a reviewer: ldionne.
Herald added subscribers: libcxx-commits, dexonsmith.
Herald added a project: libc++.
Herald added a reviewer: libc++.
zoecarver retitled this revision from "[libcxx] Suppress deprecated for __test_has_construct" to "[libcxx] Fix deprecation warning by suppressing deprecated around __test_has_construct".
zoecarver edited the summary of this revision.
zoecarver added a comment.

I'm going to commit this to fix the bots. If it would be better to revert both commits, let me know and I'll do that instead.


In C++17 some tests started failing after a521532aa16df2c06c91488f2a4e787586f0a611 <https://reviews.llvm.org/rGa521532aa16df2c06c91488f2a4e787586f0a611>. 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80481

Files:
  libcxx/include/memory


Index: libcxx/include/memory
===================================================================
--- libcxx/include/memory
+++ libcxx/include/memory
@@ -1352,9 +1352,12 @@
 
 #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(...);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80481.265890.patch
Type: text/x-patch
Size: 532 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200523/a478ffc4/attachment-0001.bin>


More information about the libcxx-commits mailing list