[libcxx-commits] [PATCH] D152097: [libc++][format] Make public functions nodiscard.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 12 09:54:03 PDT 2023


Mordante added a comment.

Thanks for the review!



================
Comment at: libcxx/test/std/utilities/format/format.arguments/format.arg.store/make_format_args.sh.cpp:27
 void test() {
-  std::make_format_args<std::basic_format_context<
-      std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>>('c');
+  TEST_IGNORE_NODISCARD
+  std::make_format_args<std::basic_format_context<std::back_insert_iterator<std::basic_string<wchar_t>>, wchar_t>>('c');
----------------
philnik wrote:
> Mordante wrote:
> > philnik wrote:
> > > Why not simply cast to void?
> > I prefer name instead of a magic invocation, @BillyONeal spend the effort to change them in D40065.
> IMO it's kind-of pointless to have a macro that just casts to void, since its people know what casting to void means, but not what a given macro actually does. It looks to me like the macro does something magical to check that it's actually ignoring nodiscard.
I like he macro since it explains why it's needed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152097



More information about the libcxx-commits mailing list