]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/variant/detail/forced_return.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / variant / detail / forced_return.hpp
index 333393a2ac7fab1e85fafcefb96aadf8eb81d9bb..d3d00a96846d80834b111aa2bdb694973394e67d 100644 (file)
@@ -4,7 +4,7 @@
 //-----------------------------------------------------------------------------
 //
 // Copyright (c) 2003 Eric Friedman
-// Copyright (c) 2015-2016 Antony Polukhin
+// Copyright (c) 2015-2019 Antony Polukhin
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -14,9 +14,7 @@
 #define BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP
 
 #include <boost/config.hpp>
-#include <boost/variant/detail/generic_result_type.hpp>
 #include <boost/assert.hpp>
-#include <cstdlib> // std::abort
 
 
 #ifdef BOOST_MSVC
 
 namespace boost { namespace detail { namespace variant {
 
-BOOST_NORETURN inline void forced_return_no_return() { // fixes `must return a value` warnings
-    using namespace std;
-    abort(); // some implementations have no std::abort
-}
-
-
 ///////////////////////////////////////////////////////////////////////////////
 // (detail) function template forced_return
 //
@@ -39,19 +31,15 @@ BOOST_NORETURN inline void forced_return_no_return() { // fixes `must return a v
 // compile-time requirement of returning a result value.
 //
 template <typename T>
-BOOST_NORETURN inline
-    BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T)
+BOOST_NORETURN inline T
 forced_return()
 {
     // logical error: should never be here! (see above)
     BOOST_ASSERT(false);
 
-    forced_return_no_return();
-
-#ifdef BOOST_NO_NORETURN
-    BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(T) (*dummy)() = 0;
-    return dummy();
-#endif
+    T (*dummy)() = 0;
+    (void)dummy;
+    BOOST_UNREACHABLE_RETURN(dummy());
 }
 
 }}} // namespace boost::detail::variant