1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // UNSUPPORTED: c++98, c++03
11
12 // <regex>
13
14 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
15
16 // basic_regex&
17 // assign(initializer_list<charT> il,
18 // flag_type f = regex_constants::ECMAScript);
19
20 #include <regex>
21 #include <cassert>
22 #include "test_macros.h"
23
main()24 int main()
25 {
26 std::regex r2;
27 r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
28 assert(r2.flags() == std::regex::ECMAScript);
29 assert(r2.mark_count() == 2);
30
31 r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
32 assert(r2.flags() == std::regex::extended);
33 assert(r2.mark_count() == 2);
34 }
35