*/
basic_regex(const _Ch_type* __p, std::size_t __len,
flag_type __f = ECMAScript)
- { _M_compile(__p, __p + __len, __f); }
+ {
+ __glibcxx_requires_string_len(__p, __len);
+ _M_compile(__p, __p + __len, __f);
+ }
/**
* @brief Copy-constructs a basic regular expression.
if constexpr (__detail::__is_contiguous_iter<_InputIterator>::value
&& is_same_v<_ValT, value_type>)
{
+ __glibcxx_requires_valid_range(__first, __last);
const auto __len = __last - __first;
const _Ch_type* __p = std::__to_address(__first);
_M_compile(__p, __p + __len, __flags);
_M_scan_in_brace();
else
{
- __glibcxx_assert(false);
+ __glibcxx_assert(!"unexpected state while processing regex");
}
}
_M_token = __it->second;
return;
}
- __glibcxx_assert(false);
+ __glibcxx_assert(!"unexpected special character in regex");
}
else
{