Merge pull request #826 from JordanMaples/dev/jomaples/ctad_fix_v2

fix ctad warning in llvm
This commit is contained in:
Jordan Maples [MSFT] 2019-11-18 13:02:53 -08:00 committed by GitHub
commit 7e99e76c97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -100,7 +100,7 @@ public:
constexpr operator T() const { return get(); } constexpr operator T() const { return get(); }
constexpr T operator->() 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 // prevents compilation when someone attempts to assign a null pointer constant
not_null(std::nullptr_t) = delete; 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)}; 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 gsl
namespace std namespace std

View File

@ -28,7 +28,7 @@ int operator_subscript_no_throw() noexcept
void setup_termination_handler() 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(); auto& handler = gsl::details::get_terminate_handler();
handler = &test_terminate; handler = &test_terminate;

View File

@ -28,7 +28,7 @@ int narrow_no_throw()
void setup_termination_handler() 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(); auto& handler = gsl::details::get_terminate_handler();
handler = &test_terminate; handler = &test_terminate;