[libcxx-commits] [PATCH] D65900: [libc++] Use [[nodiscard]] for lock_guard, as an extension

Dávid Bolvanský via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 8 12:20:55 PDT 2019


xbolva00 added inline comments.


================
Comment at: libcxx/include/__config:1016
+   // Standard specifies the constructor as [[nodiscard]]
+#  define _LIBCPP_NODISCARD_CTOR _LIBCPP_NODISCARD
+
----------------
EricWF wrote:
> What happens when we apply this attribute to a constructor with a compiler that doesn't yet support it?
> 
> Does the warning escape the system header?
If compiler returns >= 201907L, it have to support nodiscard on ctors.

Hopefully no compiler just bumps it to 201907L and does not support it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65900/new/

https://reviews.llvm.org/D65900





More information about the libcxx-commits mailing list