]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
bump: Upgrade to tl-expected 1.3.1
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 1 Sep 2025 18:14:39 +0000 (20:14 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 6 Sep 2025 08:35:46 +0000 (10:35 +0200)
LICENSE.adoc
src/third_party/tl-expected/tl/expected.hpp

index d75479a018a50f43174c13276cb13087f0dd35c3..5bda7c2072c1cac65772ee42f79b692274b74ff7 100644 (file)
@@ -521,7 +521,7 @@ DEALINGS IN THE SOFTWARE.
 
 === src/third_party/tl-expected/tl/expected.hpp
 
-This is https://github.com/TartanLlama/expected[TartanLlama expected] 1.2.0 with
+This is https://github.com/TartanLlama/expected[TartanLlama expected] 1.3.1 with
 the following license:
 
 ----
index 06e6dc4f6c7761f62df4e720d1bf0a5b9954097e..59e59aa1bd1d6b64cadf535a192082aae6c49687 100644 (file)
@@ -17,8 +17,8 @@
 #define TL_EXPECTED_HPP
 
 #define TL_EXPECTED_VERSION_MAJOR 1
-#define TL_EXPECTED_VERSION_MINOR 2
-#define TL_EXPECTED_VERSION_PATCH 0
+#define TL_EXPECTED_VERSION_MINOR 3
+#define TL_EXPECTED_VERSION_PATCH 1
 
 #include <exception>
 #include <functional>
 #define TL_EXPECTED_GCC55
 #endif
 
+#ifdef _MSVC_LANG
+#define TL_CPLUSPLUS _MSVC_LANG
+#else
+#define TL_CPLUSPLUS __cplusplus
+#endif
+
 #if !defined(TL_ASSERT)
 //can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
 #if (TL_CPLUSPLUS > 201103L) && !defined(TL_EXPECTED_GCC49)
@@ -109,12 +115,6 @@ struct is_trivially_copy_constructible<std::vector<T, A>> : std::false_type {};
   std::is_trivially_destructible<T>
 #endif
 
-#ifdef _MSVC_LANG
-#define TL_CPLUSPLUS _MSVC_LANG
-#else
-#define TL_CPLUSPLUS __cplusplus
-#endif
-
 #if TL_CPLUSPLUS > 201103L
 #define TL_EXPECTED_CXX14
 #endif
@@ -219,21 +219,13 @@ struct unexpect_t {
 };
 static constexpr unexpect_t unexpect{};
 
-namespace detail {
-template <typename E>
-[[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) {
 #ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
-  throw std::forward<E>(e);
+#define TL_EXPECTED_THROW_EXCEPTION(e) throw((e));
 #else
-  (void)e;
-#ifdef _MSC_VER
-  __assume(0);
-#else
-  __builtin_unreachable();
-#endif
+#define TL_EXPECTED_THROW_EXCEPTION(e) std::terminate();
 #endif
-}
 
+namespace detail {
 #ifndef TL_TRAITS_MUTEX
 #define TL_TRAITS_MUTEX
 // C++14-style aliases for brevity
@@ -2024,28 +2016,28 @@ public:
             detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
   TL_EXPECTED_11_CONSTEXPR const U &value() const & {
     if (!has_value())
-      detail::throw_exception(bad_expected_access<E>(err().value()));
+      TL_EXPECTED_THROW_EXCEPTION(bad_expected_access<E>(err().value()));
     return val();
   }
   template <class U = T,
             detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
   TL_EXPECTED_11_CONSTEXPR U &value() & {
     if (!has_value())
-      detail::throw_exception(bad_expected_access<E>(err().value()));
+      TL_EXPECTED_THROW_EXCEPTION(bad_expected_access<E>(err().value()));
     return val();
   }
   template <class U = T,
             detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
   TL_EXPECTED_11_CONSTEXPR const U &&value() const && {
     if (!has_value())
-      detail::throw_exception(bad_expected_access<E>(std::move(err()).value()));
+      TL_EXPECTED_THROW_EXCEPTION(bad_expected_access<E>(std::move(err()).value()));
     return std::move(val());
   }
   template <class U = T,
             detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
   TL_EXPECTED_11_CONSTEXPR U &&value() && {
     if (!has_value())
-      detail::throw_exception(bad_expected_access<E>(std::move(err()).value()));
+      TL_EXPECTED_THROW_EXCEPTION(bad_expected_access<E>(std::move(err()).value()));
     return std::move(val());
   }