assign_ptr_flag.pass.cpp 915 B

12345678910111213141516171819202122232425262728293031
  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. // <regex>
  9. // template <class charT, class traits = regex_traits<charT>> class basic_regex;
  10. // basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
  11. #include <regex>
  12. #include <cassert>
  13. #include "test_macros.h"
  14. int main(int, char**)
  15. {
  16. std::regex r2;
  17. r2.assign("(a([bc]))");
  18. assert(r2.flags() == std::regex::ECMAScript);
  19. assert(r2.mark_count() == 2);
  20. r2.assign("(a([bc]))", std::regex::extended);
  21. assert(r2.flags() == std::regex::extended);
  22. assert(r2.mark_count() == 2);
  23. return 0;
  24. }