lookahead.pass.cpp 1.0 KB

123456789101112131415161718192021222324252627282930
  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 BidirectionalIterator, class Allocator, class charT, class traits>
  10. // bool
  11. // regex_search(BidirectionalIterator first, BidirectionalIterator last,
  12. // match_results<BidirectionalIterator, Allocator>& m,
  13. // const basic_regex<charT, traits>& e,
  14. // regex_constants::match_flag_type flags = regex_constants::match_default);
  15. // https://bugs.llvm.org/show_bug.cgi?id=11118
  16. #include <regex>
  17. #include <cassert>
  18. #include "test_macros.h"
  19. int main(int, char**)
  20. {
  21. assert(!std::regex_search("ab", std::regex("(?=^)b")));
  22. assert(!std::regex_search("ab", std::regex("a(?=^)b")));
  23. return 0;
  24. }