diff options
author | Haibo Huang <hhb@google.com> | 2019-11-25 16:33:33 -0800 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2019-11-25 16:33:33 -0800 |
commit | a6355e67863610450aff55a376a61725bb3ddf09 (patch) | |
tree | 7220c449b6ebfc2e77ae784386716c5d7c497cfb | |
parent | c0efabafbf9eef1a5d97a6921cfc3fcfb4430e63 (diff) | |
parent | 7e99e76c9761d0d0b0848b91f8648830670ee872 (diff) | |
download | platform_external_Microsoft-GSL-a6355e67863610450aff55a376a61725bb3ddf09.tar.gz platform_external_Microsoft-GSL-a6355e67863610450aff55a376a61725bb3ddf09.tar.bz2 platform_external_Microsoft-GSL-a6355e67863610450aff55a376a61725bb3ddf09.zip |
Upgrade Microsoft-GSL to 7e99e76c9761d0d0b0848b91f8648830670ee872
Test: None
Change-Id: Ie72fba9f31fdd5d31fbfb65de7dfed5d9c67fad3
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | include/gsl/gsl_byte | 8 | ||||
-rw-r--r-- | include/gsl/pointers | 10 | ||||
-rw-r--r-- | tests/no_exception_ensure_tests.cpp | 2 | ||||
-rw-r--r-- | tests/no_exception_throw_tests.cpp | 2 |
5 files changed, 19 insertions, 9 deletions
@@ -5,10 +5,10 @@ third_party { type: GIT value: "https://github.com/Microsoft/GSL" } - version: "3d56ba9e7f2d61fd8c9c2a7715b46fde38c00123" + version: "7e99e76c9761d0d0b0848b91f8648830670ee872" last_upgrade_date { year: 2019 - month: 10 - day: 24 + month: 11 + day: 25 } } diff --git a/include/gsl/gsl_byte b/include/gsl/gsl_byte index 1670646..c2fc572 100644 --- a/include/gsl/gsl_byte +++ b/include/gsl/gsl_byte @@ -33,6 +33,8 @@ #include <type_traits> +// VS2017 15.8 added support for the __cpp_lib_byte definition +// To do: drop _HAS_STD_BYTE when support for pre 15.8 expires #ifdef _MSC_VER #pragma warning(push) @@ -42,15 +44,15 @@ #ifndef GSL_USE_STD_BYTE // this tests if we are under MSVC and the standard lib has std::byte and it is enabled -#if defined(_HAS_STD_BYTE) && _HAS_STD_BYTE +#if (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603) #define GSL_USE_STD_BYTE 1 -#else // defined(_HAS_STD_BYTE) && _HAS_STD_BYTE +#else // (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603) #define GSL_USE_STD_BYTE 0 -#endif // defined(_HAS_STD_BYTE) && _HAS_STD_BYTE +#endif // (defined(_HAS_STD_BYTE) && _HAS_STD_BYTE) || (defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603) #endif // GSL_USE_STD_BYTE #else // _MSC_VER diff --git a/include/gsl/pointers b/include/gsl/pointers index 7373826..7afed1c 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -100,7 +100,7 @@ public: constexpr operator T() const { return get(); } constexpr T operator->() const { return get(); } - constexpr decltype(auto) operator*() const { return *get(); } + constexpr decltype(auto) operator*() const { return *get(); } // prevents compilation when someone attempts to assign a null pointer constant not_null(std::nullptr_t) = delete; @@ -272,6 +272,14 @@ auto make_strict_not_null(T&& t) { return strict_not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)}; } +#if ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) ) + +// deduction guides to prevent the ctad-maybe-unsupported warning +template <class T> not_null(T) -> not_null<T>; +template <class T> strict_not_null(T) -> strict_not_null<T>; + +#endif // ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) ) + } // namespace gsl namespace std diff --git a/tests/no_exception_ensure_tests.cpp b/tests/no_exception_ensure_tests.cpp index b1ae15b..2ec0ebb 100644 --- a/tests/no_exception_ensure_tests.cpp +++ b/tests/no_exception_ensure_tests.cpp @@ -28,7 +28,7 @@ int operator_subscript_no_throw() noexcept void setup_termination_handler() noexcept
{
-#if defined(_MSC_VER)
+#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)
auto& handler = gsl::details::get_terminate_handler();
handler = &test_terminate;
diff --git a/tests/no_exception_throw_tests.cpp b/tests/no_exception_throw_tests.cpp index b28ad00..ddb6b07 100644 --- a/tests/no_exception_throw_tests.cpp +++ b/tests/no_exception_throw_tests.cpp @@ -28,7 +28,7 @@ int narrow_no_throw() void setup_termination_handler() noexcept
{
-#if defined(_MSC_VER)
+#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)
auto& handler = gsl::details::get_terminate_handler();
handler = &test_terminate;
|