[libcxx-commits] [PATCH] D81954: Remove the try/catch codepath if `swap` is `noexcept`.

Michael Schellenberger Costa via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 16 11:32:57 PDT 2020


miscco added a comment.

I would second @ldionne that we should add some static_assert(noexcept(...) tests



================
Comment at: libcxx/include/variant:1065
       __impl __tmp(_VSTD::move(*__rhs));
-#ifndef _LIBCPP_NO_EXCEPTIONS
-      // EXTENSION: When the move construction of `__lhs` into `__rhs` throws
-      // and `__tmp` is nothrow move constructible then we move `__tmp` back
-      // into `__rhs` and provide the strong exception safety guarantee.
-      try {
+      static constexpr bool is_noexcept =
+#ifdef _LIBCPP_NO_EXCEPTIONS
----------------
Should that be __ugly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81954





More information about the libcxx-commits mailing list