[libcxx-commits] [libcxx] [libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (PR #87094)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Apr 15 12:39:40 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
----------------
ldionne wrote:
I think this is fine. Adding nodiscard in C++17 mode to a few functions that already have it in C++20 mode is a fairly small change, and also something that we'll do (to an even greater extent) in the future, since those are now up to us.
https://github.com/llvm/llvm-project/pull/87094
More information about the libcxx-commits
mailing list