[libcxx-commits] [libcxx] [libc++][memory] Applied `[[nodiscard]]` to smart pointers (PR #168483)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 18 00:01:58 PST 2025


================
@@ -672,8 +675,8 @@ operator<=>(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {
 #endif
 
 template <class _T1, class _D1>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 bool
-operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT {
+inline _LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX23 bool operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT {
----------------
frederick-vs-ja wrote:

These 2 lines are just reformatted. Are compilers already warning on discarding comparison results by default?

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


More information about the libcxx-commits mailing list