1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // XFAIL: libcpp-no-exceptions
13 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
15 // template <class ST, class SA>
16 // basic_regex(const basic_string<charT, ST, SA>& s);
21 static bool error_escape_thrown(const char *pat)
26 } catch (const std::regex_error &ex) {
27 result = (ex.code() == std::regex_constants::error_escape);
34 assert(error_escape_thrown("[\\a]"));
35 assert(error_escape_thrown("\\a"));
36 assert(error_escape_thrown("\\"));
38 assert(error_escape_thrown("[\\e]"));
39 assert(error_escape_thrown("\\e"));
41 assert(error_escape_thrown("[\\c:]"));
42 assert(error_escape_thrown("\\c:"));
43 assert(error_escape_thrown("\\c"));
44 assert(!error_escape_thrown("[\\cA]"));
45 assert(!error_escape_thrown("\\cA"));