| 1 |
// PR c++/104646 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-additional-options -fno-elide-constructors } |
| 4 |
|
| 5 |
template <typename _T1> struct pair { |
| 6 |
_T1 first; |
| 7 |
int second; |
| 8 |
}; |
| 9 |
template <typename _Iterator> class __normal_iterator { |
| 10 |
_Iterator __traits_type; |
| 11 |
|
| 12 |
public: |
| 13 |
constexpr __normal_iterator() {} |
| 14 |
}; |
| 15 |
template <typename> class allocator; |
| 16 |
template <typename> struct allocator_traits; |
| 17 |
template <typename _Tp> struct allocator_traits<allocator<_Tp>> { |
| 18 |
using value_type = _Tp; |
| 19 |
template <typename _Up> using rebind_alloc = allocator<_Up>; |
| 20 |
}; |
| 21 |
template <typename _Alloc> struct __alloc_traits { |
| 22 |
typedef allocator_traits<_Alloc> _Base_type; |
| 23 |
typedef typename _Base_type::value_type &const_reference; |
| 24 |
template <typename _Tp> struct rebind { |
| 25 |
typedef typename _Base_type::template rebind_alloc<_Tp> other; |
| 26 |
}; |
| 27 |
}; |
| 28 |
template <typename _Tp, typename _Alloc> struct _Vector_base { |
| 29 |
typedef typename __alloc_traits<_Alloc>::template rebind<_Tp>::other _Tp_alloc_type; |
| 30 |
}; |
| 31 |
template <typename _Tp, typename _Alloc = allocator<_Tp>> class vector { |
| 32 |
public: |
| 33 |
typename __alloc_traits< |
| 34 |
typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type>::const_reference |
| 35 |
operator[](long); |
| 36 |
}; |
| 37 |
enum match_flag_type {}; |
| 38 |
template <typename, typename> class Trans_NS___cxx11_basic_regex; |
| 39 |
class Trans_NS___cxx11_match_results; |
| 40 |
enum _RegexExecutorPolicy { _S_auto }; |
| 41 |
template <typename, typename, typename _CharT, typename _TraitsT, |
| 42 |
_RegexExecutorPolicy, bool> |
| 43 |
bool __regex_algo_impl(Trans_NS___cxx11_match_results &, |
| 44 |
const Trans_NS___cxx11_basic_regex<_CharT, _TraitsT> &); |
| 45 |
template <typename, typename, typename, bool> class _Executor; |
| 46 |
template <typename _Ch_type, typename = _Ch_type> |
| 47 |
class Trans_NS___cxx11_basic_regex {}; |
| 48 |
class Trans_NS___cxx11_match_results : vector<int> { |
| 49 |
template <typename, typename, typename _Cp, typename _Rp, |
| 50 |
_RegexExecutorPolicy, bool> |
| 51 |
friend bool __regex_algo_impl(Trans_NS___cxx11_match_results &, |
| 52 |
const Trans_NS___cxx11_basic_regex<_Cp, _Rp> &); |
| 53 |
}; |
| 54 |
template <typename _Bi_iter, typename _Alloc, typename _Ch_type, |
| 55 |
typename _Rx_traits> |
| 56 |
void regex_search(_Bi_iter, _Alloc, |
| 57 |
Trans_NS___cxx11_basic_regex<_Ch_type, _Rx_traits>) { |
| 58 |
__regex_algo_impl<_Bi_iter, _Alloc, _Ch_type, _Rx_traits, _S_auto, false>; |
| 59 |
} |
| 60 |
match_flag_type __regex_algo_impl___flags; |
| 61 |
template <typename, typename, typename _CharT, typename _TraitsT, |
| 62 |
_RegexExecutorPolicy, bool> |
| 63 |
bool __regex_algo_impl( |
| 64 |
Trans_NS___cxx11_match_results &__m, |
| 65 |
const Trans_NS___cxx11_basic_regex<_CharT, _TraitsT> &__re) { |
| 66 |
__normal_iterator<const char *> __e, __s; |
| 67 |
_Executor<int, int, _TraitsT, false> __executor(__s, __e, __m, __re, |
| 68 |
__regex_algo_impl___flags); |
| 69 |
__executor._M_match(); |
| 70 |
return false; |
| 71 |
} |
| 72 |
template <typename, typename, typename, bool> class _Executor { |
| 73 |
public: |
| 74 |
_Executor(__normal_iterator<const char *>, __normal_iterator<const char *>, |
| 75 |
vector<int>, Trans_NS___cxx11_basic_regex<char>, match_flag_type); |
| 76 |
void _M_match() { _M_dfs(); } |
| 77 |
void _M_dfs(); |
| 78 |
vector<pair<__normal_iterator<char *>>> _M_rep_count; |
| 79 |
}; |
| 80 |
long _M_rep_once_more___i; |
| 81 |
template <typename _BiIter, typename _Alloc, typename _TraitsT, bool __dfs_mode> |
| 82 |
void _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::_M_dfs() { |
| 83 |
auto __rep_count = _M_rep_count[_M_rep_once_more___i]; |
| 84 |
} |
| 85 |
char main___trans_tmp_1; |
| 86 |
void main___trans_tmp_2() { |
| 87 |
Trans_NS___cxx11_basic_regex<char> re; |
| 88 |
regex_search(main___trans_tmp_1, main___trans_tmp_2, re); |
| 89 |
} |