[libcxx-commits] [PATCH] D140911: [libc++] Implement P2505R5(Monadic operations for std::expected)

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 3 11:39:10 PST 2023


huixie90 requested changes to this revision.
huixie90 added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/include/__expected/expected.h:75
   (void)__arg;
-  std::abort();
+  _VSTD::abort();
 #  endif
----------------
why all `std`s are changed to `_VSTD`? I thought we are always using `std` now


================
Comment at: libcxx/include/__expected/expected.h:867-871
+   union {
+     __empty_t __empty_;
+     _Tp __val_;
+     _Err __unex_;
+  };
----------------
I am not sure I understand this change. is this due to a wrong rebase or something? the purpose of `__empty_t` and the "named" union was to be able to apply `_LIBCPP_NO_UNIQUE_ADDRESS`


================
Comment at: libcxx/test/libcxx/utilities/expected/expected.expected/no_unique_address.compile.pass.cpp:1-19
-//===----------------------------------------------------------------------===//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
----------------
Why this test is deleted?


================
Comment at: libcxx/test/libcxx/utilities/expected/expected.void/no_unique_address.compile.pass.cpp:18
-struct Empty {};
-
-static_assert(sizeof(std::expected<void, Empty>) == sizeof(bool));
----------------
why is this test deleted?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140911



More information about the libcxx-commits mailing list