Skip to content

Commit 7e99e76

Browse files
authored
Merge pull request #826 from JordanMaples/dev/jomaples/ctad_fix_v2
fix ctad warning in llvm
2 parents 9939d58 + 263440f commit 7e99e76

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

include/gsl/pointers

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public:
100100

101101
constexpr operator T() const { return get(); }
102102
constexpr T operator->() const { return get(); }
103-
constexpr decltype(auto) operator*() const { return *get(); }
103+
constexpr decltype(auto) operator*() const { return *get(); }
104104

105105
// prevents compilation when someone attempts to assign a null pointer constant
106106
not_null(std::nullptr_t) = delete;
@@ -272,6 +272,14 @@ auto make_strict_not_null(T&& t) {
272272
return strict_not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)};
273273
}
274274

275+
#if ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) )
276+
277+
// deduction guides to prevent the ctad-maybe-unsupported warning
278+
template <class T> not_null(T) -> not_null<T>;
279+
template <class T> strict_not_null(T) -> strict_not_null<T>;
280+
281+
#endif // ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) )
282+
275283
} // namespace gsl
276284

277285
namespace std

tests/no_exception_ensure_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int operator_subscript_no_throw() noexcept
2828

2929
void setup_termination_handler() noexcept
3030
{
31-
#if defined(_MSC_VER)
31+
#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)
3232

3333
auto& handler = gsl::details::get_terminate_handler();
3434
handler = &test_terminate;

tests/no_exception_throw_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int narrow_no_throw()
2828

2929
void setup_termination_handler() noexcept
3030
{
31-
#if defined(_MSC_VER)
31+
#if defined(GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND)
3232

3333
auto& handler = gsl::details::get_terminate_handler();
3434
handler = &test_terminate;

0 commit comments

Comments
 (0)