aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>2019-11-18 13:02:53 -0800
committerGitHub <noreply@github.com>2019-11-18 13:02:53 -0800
commit7e99e76c9761d0d0b0848b91f8648830670ee872 (patch)
treee9b1ccab3d8615a381d6895afff8cfff7536f400
parent9939d5889bc2bcde2ac17a026313d0960d6d799a (diff)
parent263440f2a10cf016b0ab18071508b6fde4ebdfc6 (diff)
downloadplatform_external_Microsoft-GSL-7e99e76c9761d0d0b0848b91f8648830670ee872.tar.gz
platform_external_Microsoft-GSL-7e99e76c9761d0d0b0848b91f8648830670ee872.tar.bz2
platform_external_Microsoft-GSL-7e99e76c9761d0d0b0848b91f8648830670ee872.zip
Merge pull request #826 from JordanMaples/dev/jomaples/ctad_fix_v2
fix ctad warning in llvm
-rw-r--r--include/gsl/pointers10
-rw-r--r--tests/no_exception_ensure_tests.cpp2
-rw-r--r--tests/no_exception_throw_tests.cpp2
3 files changed, 11 insertions, 3 deletions
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;