[libcxx-commits] [PATCH] D68879: P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.

Richard Smith - zygoloid via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 11 13:35:19 PDT 2019


rsmith added inline comments.


================
Comment at: libcxx/include/__config:966
 
+// Macros to enter and leave a state where deprecation warnings are suppressed.
+#if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \
----------------
ldionne wrote:
> Please document that we're talking about compiler deprecation warnings, otherwise this can be confused as also turning off library deprecation warnings. Ignoring `-Wdeprecated` won't have that effect, right?
> 
> ```
> // Macros to enter and leave a state where compiler deprecation warnings are suppressed. This doesn't impact library deprecation warnings.
> ```
> 
> Or something along those lines.
> 
Ignoring `-Wdeprecated` turns off all deprecation warnings, regardless of whether they come from attributes or something else. (This might also be useful if libc++ wants to implement something in terms of deprecated library functionality.)


================
Comment at: libcxx/include/type_traits:1123
+// Suppress deprecation notice for volatile-qualified return type.
+_LIBCPP_SUPPRESS_DEPRECATED_PUSH
 template <class _Tp> _Tp&& __declval(int);
----------------
ldionne wrote:
> Wait, I don't see any `volatile` qualification here?
The volatile comes from `_Tp`, specified indirectly through various callers that internally use `declval`. In particular, the `is_invocable<volatile T>` tests end up here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68879/new/

https://reviews.llvm.org/D68879





More information about the libcxx-commits mailing list