https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81002
Bug ID: 81002 Summary: std::basic_regex can't be constructed from non-contiguous iterators Product: gcc Version: 5.4.1 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- #include <regex> #include <forward_list> int main() { std::forward_list<char> l; std::regex r(l.begin(), l.end()); } In file included from /home/jwakely/gcc/5/include/c++/5.4.1/regex:60:0, from re.cc:1: /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h: In instantiation of ‘std::__detail::__disable_if_contiguous_normal_iter<_FwdIter, _TraitsT> std::__detail::__compile_nfa(_FwdIter, _FwdIter, const typename _TraitsT::locale_type&, std::regex_constants::syntax_option_type) [with _FwdIter = std::_Fwd_list_iterator<char>; _TraitsT = std::__cxx11::regex_traits<char>; std::__detail::__disable_if_contiguous_normal_iter<_FwdIter, _TraitsT> = std::shared_ptr<const std::__detail::_NFA<std::__cxx11::regex_traits<char> > >; typename _TraitsT::locale_type = std::locale]’: /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex.h:766:60: required from ‘std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::basic_regex(_FwdIter, _FwdIter, std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::locale_type, std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::flag_type) [with _FwdIter = std::_Fwd_list_iterator<char>; _Ch_type = char; _Rx_traits = std::__cxx11::regex_traits<char>; std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::locale_type = std::locale; std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::flag_type = std::regex_constants::syntax_option_type]’ /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex.h:512:73: required from ‘std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::basic_regex(_FwdIter, _FwdIter, std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::flag_type) [with _FwdIter = std::_Fwd_list_iterator<char>; _Ch_type = char; _Rx_traits = std::__cxx11::regex_traits<char>; std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::flag_type = std::regex_constants::syntax_option_type]’ re.cc:7:36: required from here /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:204:27: error: no matching function for call to ‘__compile_nfa(const char*, const char*, const locale_type&, std::regex_constants::syntax_option_type&)’ return __compile_nfa(__str.data(), __str.data() + __str.size(), __loc, ^ /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:187:5: note: candidate: template<class _FwdIter, class _TraitsT> std::__detail::__enable_if_contiguous_normal_iter<_FwdIter, _TraitsT> std::__detail::__compile_nfa(_FwdIter, _FwdIter, const typename _TraitsT::locale_type&, std::regex_constants::syntax_option_type) __compile_nfa(_FwdIter __first, _FwdIter __last, ^ /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:187:5: note: template argument deduction/substitution failed: /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:204:27: note: couldn't deduce template parameter ‘_TraitsT’ return __compile_nfa(__str.data(), __str.data() + __str.size(), __loc, ^ /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:199:5: note: candidate: template<class _FwdIter, class _TraitsT> std::__detail::__disable_if_contiguous_normal_iter<_FwdIter, _TraitsT> std::__detail::__compile_nfa(_FwdIter, _FwdIter, const typename _TraitsT::locale_type&, std::regex_constants::syntax_option_type) __compile_nfa(_FwdIter __first, _FwdIter __last, ^ /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:199:5: note: template argument deduction/substitution failed: /home/jwakely/gcc/5/include/c++/5.4.1/bits/regex_compiler.h:204:27: note: couldn't deduce template parameter ‘_TraitsT’ return __compile_nfa(__str.data(), __str.data() + __str.size(), __loc, ^