[libcxx-commits] [libcxx] [libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (PR #87094)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 5 03:23:42 PDT 2024


================
@@ -1427,20 +1427,6 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
 #    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
----------------
philnik777 wrote:

CC @llvm/libcxx-vendors

If nobody complains I think we can just remove them.

I don't see anybody using `_LIBCPP_NODISCARD_AFTER_CXX17` downstream, since it's been there for applications in the standard. `_LIBCPP_NODISCARD_EXT` might be used, but the fix is to replace `_LIBCPP_NODISCARD_EXT` with `_LIBCPP_NODISCARD`, which is a task of a few minutes.

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


More information about the libcxx-commits mailing list