| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // UNSUPPORTED: c++03 |
| 10 | |
| 11 | // <regex> |
| 12 | |
| 13 | // template <class charT, class traits = regex_traits<charT>> class basic_regex; |
| 14 | |
| 15 | // basic_regex& |
| 16 | // assign(initializer_list<charT> il, |
| 17 | // flag_type f = regex_constants::ECMAScript); |
| 18 | |
| 19 | #include <regex> |
| 20 | #include <cassert> |
| 21 | #include "test_macros.h" |
| 22 | |
| 23 | int main(int, char**) |
| 24 | { |
| 25 | std::regex r2; |
| 26 | r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}); |
| 27 | assert(r2.flags() == std::regex::ECMAScript); |
| 28 | assert(r2.mark_count() == 2); |
| 29 | |
| 30 | r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended); |
| 31 | assert(r2.flags() == std::regex::extended); |
| 32 | assert(r2.mark_count() == 2); |
| 33 | |
| 34 | return 0; |
| 35 | } |
| 36 | |