Skip to content

Commit

Permalink
Merge pull request #826 from JordanMaples/dev/jomaples/ctad_fix_v2
Browse files Browse the repository at this point in the history
fix ctad warning in llvm
  • Loading branch information
JordanMaples committed Nov 18, 2019
2 parents 9939d58 + 263440f commit 7e99e76
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion include/gsl/pointers
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/no_exception_ensure_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/no_exception_throw_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7e99e76

Please sign in to comment.