[libcxx-commits] [libcxx] r372896 - Add a missing default parameter to regex::assign. This is LWG3296; reviewed as https://reviews.llvm.org/D67944
Marshall Clow via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Sep 25 09:40:31 PDT 2019
Author: marshall
Date: Wed Sep 25 09:40:30 2019
New Revision: 372896
URL: http://llvm.org/viewvc/llvm-project?rev=372896&view=rev
Log:
Add a missing default parameter to regex::assign. This is LWG3296; reviewed as https://reviews.llvm.org/D67944
Modified:
libcxx/trunk/include/regex
libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
Modified: libcxx/trunk/include/regex
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/regex?rev=372896&r1=372895&r2=372896&view=diff
==============================================================================
--- libcxx/trunk/include/regex (original)
+++ libcxx/trunk/include/regex Wed Sep 25 09:40:30 2019
@@ -169,15 +169,15 @@ public:
// assign:
basic_regex& assign(const basic_regex& that);
basic_regex& assign(basic_regex&& that) noexcept;
- basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
- basic_regex& assign(const charT* p, size_t len, flag_type f);
+ basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
+ basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
template <class string_traits, class A>
basic_regex& assign(const basic_string<charT, string_traits, A>& s,
- flag_type f = regex_constants::ECMAScript);
+ flag_type f = regex_constants::ECMAScript);
template <class InputIterator>
basic_regex& assign(InputIterator first, InputIterator last,
- flag_type f = regex_constants::ECMAScript);
- basic_regex& assign(initializer_list<charT>, flag_type = regex_constants::ECMAScript);
+ flag_type f = regex_constants::ECMAScript);
+ basic_regex& assign(initializer_list<charT>, flag_type f = regex_constants::ECMAScript);
// const operations:
unsigned mark_count() const;
@@ -2617,7 +2617,7 @@ public:
basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
{return assign(__p, __p + __traits_.length(__p), __f);}
_LIBCPP_INLINE_VISIBILITY
- basic_regex& assign(const value_type* __p, size_t __len, flag_type __f)
+ basic_regex& assign(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
{return assign(__p, __p + __len, __f);}
template <class _ST, class _SA>
_LIBCPP_INLINE_VISIBILITY
Modified: libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp?rev=372896&r1=372895&r2=372896&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp Wed Sep 25 09:40:30 2019
@@ -18,6 +18,16 @@
int main(int, char**)
{
+ std::regex r0;
+ r0.assign("(a([bc]))", 9);
+ assert(r0.flags() == std::regex::ECMAScript);
+ assert(r0.mark_count() == 2);
+
+ std::regex r1;
+ r1.assign("(a([bc]))", 9, std::regex::ECMAScript);
+ assert(r1.flags() == std::regex::ECMAScript);
+ assert(r1.mark_count() == 2);
+
std::regex r2;
r2.assign("(a([bc]))", 9, std::regex::extended);
assert(r2.flags() == std::regex::extended);
More information about the libcxx-commits
mailing list