Skip to content

Commit 928cad5

Browse files
committed
[libc++][NFC] Rename _LIBCPP_NODISCARD_ATTRIBUTE to _LIBCPP_NODISCARD
Differential Revision: https://reviews.llvm.org/D108940
1 parent e781e03 commit 928cad5

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

libcxx/include/__config

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,30 +1052,28 @@ typedef unsigned int char32_t;
10521052
# define _LIBCPP_CONSTEXPR_AFTER_CXX17
10531053
#endif
10541054

1055-
// The _LIBCPP_NODISCARD_ATTRIBUTE should only be used to define other
1056-
// NODISCARD macros to the correct attribute.
10571055
#if __has_cpp_attribute(nodiscard) || defined(_LIBCPP_COMPILER_MSVC)
1058-
# define _LIBCPP_NODISCARD_ATTRIBUTE [[nodiscard]]
1056+
# define _LIBCPP_NODISCARD [[nodiscard]]
10591057
#elif defined(_LIBCPP_COMPILER_CLANG_BASED) && !defined(_LIBCPP_CXX03_LANG)
1060-
# define _LIBCPP_NODISCARD_ATTRIBUTE [[clang::warn_unused_result]]
1058+
# define _LIBCPP_NODISCARD [[clang::warn_unused_result]]
10611059
#else
10621060
// We can't use GCC's [[gnu::warn_unused_result]] and
10631061
// __attribute__((warn_unused_result)), because GCC does not silence them via
10641062
// (void) cast.
1065-
# define _LIBCPP_NODISCARD_ATTRIBUTE
1063+
# define _LIBCPP_NODISCARD
10661064
#endif
10671065

10681066
// _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
10691067
// specified as such as an extension.
10701068
#if defined(_LIBCPP_ENABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
1071-
# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD_ATTRIBUTE
1069+
# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD
10721070
#else
10731071
# define _LIBCPP_NODISCARD_EXT
10741072
#endif
10751073

10761074
#if !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17) && \
10771075
(_LIBCPP_STD_VER > 17 || defined(_LIBCPP_ENABLE_NODISCARD))
1078-
# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD_ATTRIBUTE
1076+
# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
10791077
#else
10801078
# define _LIBCPP_NODISCARD_AFTER_CXX17
10811079
#endif

libcxx/include/type_traits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,7 @@ template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
23402340

23412341
#ifndef _LIBCPP_CXX03_LANG
23422342
template <class _Tp>
2343-
_LIBCPP_NODISCARD_ATTRIBUTE _LIBCPP_INLINE_VISIBILITY constexpr
2343+
_LIBCPP_HIDE_FROM_ABI constexpr
23442344
typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept {
23452345
return static_cast<typename make_unsigned<_Tp>::type>(__x);
23462346
}

0 commit comments

Comments
 (0)