[PATCH] D55741: Implementation Feature Test Macros for P0722R3

Jonathan Wakely via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 16 16:02:32 PST 2019


jwakely added a comment.

The simplest solution would be to change libstdc++'s `<new>` to:

  #if __cplusplus >= 201703L && __cpp_impl_destroying_delete
  #define __cpp_lib_destroying_delete 201806L

Or we could be fancier and do:

  #if __cplusplus >= 201103L && __cpp_impl_destroying_delete
  namespace std
  {
    struct destroying_delete_t
    {
      explicit destroying_delete_t() = default;
    };
  #if __cplusplus >= 201703L
  # define __cpp_lib_destroying_delete 201806L
    inline constexpr destroying_delete_t destroying_delete{};
  #endif
  }
  #endif // destroying delete

i.e. define the type for C++11 and later, and the inline variable (and feature-test macro) only for C++17 when inline variables are supported.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55741





More information about the cfe-commits mailing list