assign.il.pass.cpp 1005 B

12345678910111213141516171819202122232425262728293031323334
  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. // UNSUPPORTED: c++98, c++03
  10. // <regex>
  11. // template <class charT, class traits = regex_traits<charT>> class basic_regex;
  12. // basic_regex&
  13. // assign(initializer_list<charT> il,
  14. // flag_type f = regex_constants::ECMAScript);
  15. #include <regex>
  16. #include <cassert>
  17. #include "test_macros.h"
  18. int main()
  19. {
  20. std::regex r2;
  21. r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
  22. assert(r2.flags() == std::regex::ECMAScript);
  23. assert(r2.mark_count() == 2);
  24. r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
  25. assert(r2.flags() == std::regex::extended);
  26. assert(r2.mark_count() == 2);
  27. }