[libcxx-commits] [libcxx] [libc++][NFC] Move QoI attributes into a single place inside <__config> (PR #70870)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 2 09:15:03 PDT 2023


================
@@ -1031,35 +1008,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
 #    define _LIBCPP_CONSTEXPR_SINCE_CXX23
 #  endif
 
-#  if __has_cpp_attribute(nodiscard)
-#    define _LIBCPP_NODISCARD [[__nodiscard__]]
-#  else
-// We can't use GCC's [[gnu::warn_unused_result]] and
-// __attribute__((warn_unused_result)), because GCC does not silence them via
-// (void) cast.
-#    define _LIBCPP_NODISCARD
-#  endif
-
-// _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
-// specified as such as an extension.
-#  if !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
-#    define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD
-#  else
-#    define _LIBCPP_NODISCARD_EXT
-#  endif
-
-#  if _LIBCPP_STD_VER >= 20 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
-#    define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
-#  else
-#    define _LIBCPP_NODISCARD_AFTER_CXX17
-#  endif
-
-#  if __has_attribute(__no_destroy__)
-#    define _LIBCPP_NO_DESTROY __attribute__((__no_destroy__))
-#  else
-#    define _LIBCPP_NO_DESTROY
----------------
ldionne wrote:

This one is unused entirely, we should remove it. I would do that in a separate NFC patch where we clean up all the ones we can find that are unused.

https://github.com/llvm/llvm-project/pull/70870


More information about the libcxx-commits mailing list