[PATCH] D48912: [libc++] Add deprecated attributes to many deprecated components

JF Bastien via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 16:43:46 PDT 2018


jfb added a comment.

In general this lgtm. First comment I think you need to fix, others can go together in a follow-up I think.



================
Comment at: libcxx/docs/UsingLibcxx.rst:212
+  will trigger a warning saying that `std::auto_ptr` is deprecated. By default,
+  this macro is not defined.
+
----------------
I thought you'd agreed on IRC to have it defined by default (i.e. enable deprecation warnings by default)?

On-by-default sounds right to me, since that's what the Standard is effectively asking for. I agree we'll make some developers sad, but they'll be even more sad when deprecated features get removed entirely.


================
Comment at: libcxx/include/__config:1006
+#  define _LIBCPP_DEPRECATED_IN_CXX17
+#endif
+
----------------
I assume all of the above will work with deleted things because they'll be behind a macro that `#if 0`'s them when deleted (and then a user can turn the deleted feature back on with another macro?). Or do we just delete things outright?


================
Comment at: libcxx/include/memory:2059
 template <class _Tp>
-struct auto_ptr_ref
+struct _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr_ref
 {
----------------
So here's an example where, if you define `_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR` you can come back and get `auto_ptr` and then you get the deprecated warning. Should we have another macro that says (for this one) "deprecated in 11, removed in 17 but you asked to get it back, srlys why?"


Repository:
  rL LLVM

https://reviews.llvm.org/D48912





More information about the llvm-commits mailing list