mclow.lists added a comment.

In https://reviews.llvm.org/D45179#1077055, @thakis wrote:

> So you're happy with this opt-in version?


I'm happy with an opt-in mechanism, yes.
This one is not quite right yet.

BTW, I expect a //large// set of calls in the standard library to get marked as 
`[[nodiscard]]` in Rapperswil.



================
Comment at: include/__config:1016
+// because GCC does not silence them via (void) cast.
+#if __has_cpp_attribute(nodiscard) && _LIBCPP_STD_VER > 17
+#  define _LIBCPP_NODISCARD [[nodiscard]]
----------------
`[[nodiscard]]` is a C++17 feature. This test should be `>=`, not `>`.


================
Comment at: include/__config:1026
+    (_LIBCPP_STD_VER > 17 || defined(_LIBCPP_FORCE_NODISCARD))
+#  define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
 #else
----------------
I wouldn't change this; just leave it as `[[nodiscard]]`


Repository:
  rCXX libc++

https://reviews.llvm.org/D45179



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to