#define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS
#endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
-#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
-#define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-#endif
-
#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
#define _LIBCPP_HAS_NO_COROUTINES
#endif
#endif // _LIBCPP_NO_RTTI
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _Rp, class ..._Ap>
function(_Rp(*)(_Ap...)) -> function<_Rp(_Ap...)>;
template<class _Fp, class _Stripped = typename __strip_signature<decltype(&_Fp::operator())>::type>
function(_Fp) -> function<_Stripped>;
-#endif // !_LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif // _LIBCPP_STD_VER >= 17
template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>::function(const function& __f) : __f_(__f.__f_) {}
#endif // _LIBCPP_CXX03_LANG
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template <class _Tp>
reference_wrapper(_Tp&) -> reference_wrapper<_Tp>;
#endif
__has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
!__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator>
using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
using __iter_to_alloc_type = pair<
add_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>,
typename iterator_traits<_InputIterator>::value_type::second_type>;
-#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_END_NAMESPACE_STD
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _Tp>
shared_ptr(weak_ptr<_Tp>) -> shared_ptr<_Tp>;
template<class _Tp, class _Dp>
template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _Tp>
weak_ptr(shared_ptr<_Tp>) -> weak_ptr<_Tp>;
#endif
#endif
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _T1, class _T2>
pair(_T1, _T2) -> pair<_T1, _T2>;
-#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif
template <class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _Tp, class... _Args,
class = _EnableIf<__all<_IsSame<_Tp, _Args>::value...>::value>
>
void __move_assign(deque& __c, false_type);
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = _EnableIf<__is_allocator<_Alloc>::value>
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = _EnableIf<__is_allocator<_Alloc>::value>
void __move_assign(list& __c, false_type);
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = _EnableIf<__is_allocator<_Alloc>::value>
#endif
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
class = _EnableIf<!__is_allocator<_Compare>::value, void>,
typedef unique_ptr<__node, _Dp> __node_holder;
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator, class _Compare = less<__iter_key_type<_InputIterator>>,
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
class = _EnableIf<!__is_allocator<_Compare>::value, void>,
using __base::reset;
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class T>
optional(T) -> optional<T>;
#endif
operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _Container,
class = _EnableIf<!__is_allocator<_Container>::value>
>
__is_nothrow_swappable<value_compare>::value);
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template <class _Compare,
class _Container,
class = _EnableIf<!__is_allocator<_Compare>::value>,
template <class, class> friend class __lookahead;
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template <class _ForwardIterator,
class = typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value, nullptr_t>::type
>
#endif
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
#endif
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Compare = less<__iter_value_type<_InputIterator>>,
class _Allocator = allocator<__iter_value_type<_InputIterator>>,
operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y);
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _Container,
class = _EnableIf<!__is_allocator<_Container>::value>
>
#endif
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _CharT = __iter_value_type<_InputIterator>,
class _Allocator = allocator<_CharT>,
void swap(tuple&) _NOEXCEPT {}
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template <class ..._Tp>
tuple(_Tp...) -> tuple<_Tp...>;
template <class _Tp1, class _Tp2>
#endif
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Hash = hash<__iter_key_type<_InputIterator>>,
class _Pred = equal_to<__iter_key_type<_InputIterator>>,
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Hash = hash<__iter_key_type<_InputIterator>>,
class _Pred = equal_to<__iter_key_type<_InputIterator>>,
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Hash = hash<__iter_value_type<_InputIterator>>,
class _Pred = equal_to<__iter_value_type<_InputIterator>>,
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Hash = hash<__iter_value_type<_InputIterator>>,
class _Pred = equal_to<__iter_value_type<_InputIterator>>,
}
};
-#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#if _LIBCPP_STD_VER >= 17
template<class _InputIterator,
class _Alloc = allocator<__iter_value_type<_InputIterator>>,
class = _EnableIf<__is_allocator<_Alloc>::value>
// <map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// clang-6 gives different error messages.
// <map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Compare = less<iter-value-type<InputIterator>>,
// <map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Compare = less<iter-value-type<InputIterator>>,
// <map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// clang-6 gives different error messages.
// <map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Compare = less<iter-value-type<InputIterator>>,
// <map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Compare = less<iter-value-type<InputIterator>>,
// <set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// clang-6 gives different error messages.
// <set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// UNSUPPORTED: apple-clang-9.1
// template<class InputIterator,
// <set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// clang-6 gives different error messages.
// <set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// UNSUPPORTED: apple-clang-9.1
// template<class InputIterator,
// <queue>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
#include <queue>
#include <deque>
// <queue>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class Compare, class Container>
// priority_queue(Compare, Container)
// <queue>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
#include <queue>
#include <list>
// <queue>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
// Clang 5 will generate bad implicit deduction guides
// Specifically, for the copy constructor.
// <stack>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// vector(InputIterator, InputIterator, Allocator = Allocator())
// <stack>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
// Clang 5 will generate bad implicit deduction guides
// Specifically, for the copy constructor.
-
// template<class Container>
// stack(Container) -> stack<typename Container::value_type, Container>;
//
// <array>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class T, class... U>
// array(T, U...) -> array<T, 1 + sizeof...(U)>;
// <array>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
// Clang 5 will generate bad implicit deduction guides
// Specifically, for the copy constructor.
-
// template <class T, class... U>
// array(T, U...) -> array<T, 1 + sizeof...(U)>;
//
// Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed.
-
#include <array>
#include <cassert>
#include <cstddef>
// <array>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// deque(InputIterator, InputIterator, Allocator = Allocator())
// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <deque>
#include <iterator>
#include <cassert>
// <deque>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// deque(InputIterator, InputIterator, Allocator = Allocator())
// -> deque<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <deque>
#include <iterator>
#include <cassert>
// <forward_list>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// forward_list(InputIterator, InputIterator, Allocator = Allocator())
// -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <forward_list>
#include <iterator>
#include <cassert>
// <forward_list>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// forward_list(InputIterator, InputIterator, Allocator = Allocator())
// -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <forward_list>
#include <iterator>
#include <cassert>
// <list>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// list(InputIterator, InputIterator, Allocator = Allocator())
// -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <list>
#include <iterator>
#include <cassert>
// <list>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// list(InputIterator, InputIterator, Allocator = Allocator())
// -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <list>
#include <iterator>
#include <cassert>
// <vector>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// vector(InputIterator, InputIterator, Allocator = Allocator())
// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <deque>
#include <iterator>
#include <cassert>
// <vector>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// vector(InputIterator, InputIterator, Allocator = Allocator())
// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <vector>
#include <iterator>
#include <cassert>
// <unordered_map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// template<class InputIterator,
// <unordered_map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Hash = hash<iter-key-type<InputIterator>>,
// <unordered_map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Hash = hash<iter-key-type<InputIterator>>,
// <unordered_map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// template<class InputIterator,
// <unordered_map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Hash = hash<iter-key-type<InputIterator>>,
// <unordered_map>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class InputIterator,
// class Hash = hash<iter-key-type<InputIterator>>,
// <unordered_set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// template<class InputIterator,
// <unordered_set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// UNSUPPORTED: apple-clang-9.1
// template<class InputIterator,
// <unordered_set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// XFAIL: clang-6, apple-clang-9.0, apple-clang-9.1, apple-clang-10.0.0
// template<class InputIterator,
// <unordered_set>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// UNSUPPORTED: apple-clang-9.1
// template<class InputIterator,
// <regex>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
// vector(InputIterator, InputIterator, Allocator = Allocator())
// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
//
-
#include <regex>
#include <string>
#include <iterator>
// <regex>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
-
// template<class ForwardIterator>
// basic_regex(ForwardIterator, ForwardIterator,
// regex_constants::syntax_option_type = regex_constants::ECMAScript)
// -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
-
#include <regex>
#include <string>
#include <iterator>
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// <string>
// <string>
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
// template<class InputIterator>
// basic_string(InputIterator begin, InputIterator end,
// is a type that does not qualify as an input iterator, or if Allocator is a type
// that does not qualify as an allocator.
-
#include <string>
#include <iterator>
#include <cassert>
// <string>
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
// template<class InputIterator>
// basic_string(InputIterator begin, InputIterator end,
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
-
#include <string>
#include <string_view>
#include <iterator>
// <string>
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
// template<class InputIterator>
// basic_string(InputIterator begin, InputIterator end,
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
-
#include <string>
#include <string_view>
#include <iterator>
// <string>
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
// template<class InputIterator>
// basic_string(InputIterator begin, InputIterator end,
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
-
#include <string>
#include <string_view>
#include <iterator>
// <string>
// UNSUPPORTED: c++03, c++11, c++14
-// XFAIL: libcpp-no-deduction-guides
// template<class InputIterator>
// basic_string(InputIterator begin, InputIterator end,
// The deduction guide shall not participate in overload resolution if Allocator
// is a type that does not qualify as an allocator.
-
#include <string>
#include <string_view>
#include <iterator>
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// <string_view>
m.lock();
m.unlock();
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
std::lock_guard lg(m);
static_assert((std::is_same<decltype(lg), std::lock_guard<decltype(m)>>::value), "" );
#endif
}
#endif
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
{
TestMutex m1, m2, m3;
{
q.join();
}
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
std::shared_lock sl(m);
static_assert((std::is_same<decltype(sl), std::shared_lock<decltype(m)>>::value), "" );
#endif
m.unlock();
t.join();
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
std::unique_lock ul(m);
static_assert((std::is_same<decltype(ul), std::unique_lock<decltype(m)>>::value), "" );
#endif
// function(F) -> function<see-below>;
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// The deduction guides for std::function do not handle rvalue-ref qualified
// call operators and C-style variadics. It also doesn't deduce from nullptr_t.
#include <functional>
#include <type_traits>
-
struct R { };
struct f0 { R operator()() && { return {}; } };
struct f1 { R operator()(int, ...) { return {}; } };
// function(F) -> function<see-below>;
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
#include <functional>
#include <type_traits>
#include "test_macros.h"
-
struct R { };
struct A1 { };
struct A2 { };
// function(R(*)(Args...)) -> function<R(Args...)>;
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
#include <functional>
#include <type_traits>
#include "test_macros.h"
-
struct R { };
struct A1 { };
struct A2 { };
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// <functional>
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
struct convertible_to_int_ref {
int val = 0;
operator int&() { return val; }
(true) ? purr() : 0;
}
-#ifdef __cpp_deduction_guides
+#if TEST_STD_VER >= 17
{
int i = 0;
std::reference_wrapper ri(i);
// <memory>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class T> class shared_ptr
// <memory>
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// template<class T> class weak_ptr
// <optional>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-5
-// UNSUPPORTED: libcpp-no-deduction-guides
// Clang 5 will generate bad implicit deduction guides
// Specifically, for the copy constructor.
-
// template<class T>
// optional(T) -> optional<T>;
-
#include <optional>
#include <cassert>
// <optional>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-5, apple-clang-9
-// UNSUPPORTED: libcpp-no-deduction-guides
// Clang 5 will generate bad implicit deduction guides
// Specifically, for the copy constructor.
-
// template<class T>
// optional(T) -> optional<T>;
-
#include <optional>
#include <cassert>
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// UNSUPPORTED: apple-clang-9
// GCC's implementation of class template deduction is still immature and runs
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-deduction-guides
// GCC's implementation of class template deduction is still immature and runs
// into issues with libc++. However GCC accepts this code when compiling
Feature(name='fdelayed-template-parsing', when=lambda cfg: hasCompileFlag(cfg, '-fdelayed-template-parsing')),
Feature(name='libcpp-no-if-constexpr', when=lambda cfg: '__cpp_if_constexpr' not in featureTestMacros(cfg)),
Feature(name='libcpp-no-structured-bindings', when=lambda cfg: '__cpp_structured_bindings' not in featureTestMacros(cfg)),
- Feature(name='libcpp-no-deduction-guides', when=lambda cfg: featureTestMacros(cfg).get('__cpp_deduction_guides', 0) < 201611),
Feature(name='libcpp-no-concepts', when=lambda cfg: featureTestMacros(cfg).get('__cpp_concepts', 0) < 201907),
Feature(name='has-fobjc-arc', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.