Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/wrappers/wrapper-around-type-pack-expansion.C Thu Oct 25 07:37:49 2018 +0900 @@ -0,0 +1,50 @@ +// { dg-do compile { target c++11 } } + +typedef long unsigned int size_t; + +template<typename _Tp> +struct remove_reference {}; + +template<typename _Tp> +constexpr _Tp&& +forward(typename remove_reference<_Tp>::type& __t) noexcept +{ +} + +struct __allocator_traits_base { + template<typename _Tp, typename _Up, typename = void> + struct __rebind + { + using type = typename _Tp::template rebind<_Up>::other; + }; +}; + +template<typename _Alloc, typename _Up> +using __alloc_rebind = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type; + +template<typename _Alloc> struct allocator_traits { + template<typename _Tp> using rebind_alloc = __alloc_rebind<_Alloc, _Tp>; + template<typename _Tp, typename... _Args> + static auto construct(_Alloc& __a, _Tp* __p, _Args&&... __args) + -> decltype(_S_construct(__a, __p, forward<_Args>(__args)...)) { } +}; + +template<typename _Alloc, typename = typename _Alloc::value_type> +struct __alloc_traits : allocator_traits<_Alloc> { + typedef allocator_traits<_Alloc> _Base_type; + template<typename _Tp> struct rebind { typedef typename _Base_type::template rebind_alloc<_Tp> other; }; +}; + +template<typename _Tp> class allocator { + typedef _Tp value_type; + template<typename _Tp1> struct rebind { typedef allocator<_Tp1> other; }; +}; + +template<typename _CharT, typename _Alloc> +class basic_string { + typedef typename __alloc_traits<_Alloc>::template rebind<_CharT>::other _Char_alloc_type; +}; + +template<size_t _Nw> struct _Base_bitset { + static void foo (basic_string<char, allocator<char> >) {} +};