[libcxx-commits] [libcxx] [libc++][ios] Applied `[[nodiscard]]` (PR #173520)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 25 05:15:34 PST 2025
================
@@ -575,43 +575,43 @@ public:
# ifdef _LIBCPP_CXX03_LANG
// Preserve the ability to compare with literal 0,
// and implicitly convert to bool, but not implicitly convert to int.
- _LIBCPP_HIDE_FROM_ABI operator void*() const { return fail() ? nullptr : (void*)this; }
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI operator void*() const { return fail() ? nullptr : (void*)this; }
# else
- _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); }
+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI explicit operator bool() const { return !fail(); }
----------------
philnik777 wrote:
These annotations are incorrect and untested.
https://github.com/llvm/llvm-project/pull/173520
More information about the libcxx-commits
mailing list