1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: no-exceptions
13 // the "n" in `a{n}` should be within the numeric limits.
17 #include "test_macros.h"
19 int main(int, char**) {
20 for (std::regex_constants::syntax_option_type op
:
21 {std::regex::basic
, std::regex::grep
}) {
23 TEST_IGNORE_NODISCARD
std::regex("a\\{100000000000000000\\}", op
);
25 } catch (const std::regex_error
&e
) {
26 assert(e
.code() == std::regex_constants::error_badbrace
);
29 for (std::regex_constants::syntax_option_type op
:
30 {std::regex::ECMAScript
, std::regex::extended
, std::regex::egrep
,
33 TEST_IGNORE_NODISCARD
std::regex("a{100000000000000000}", op
);
35 } catch (const std::regex_error
&e
) {
36 assert(e
.code() == std::regex_constants::error_badbrace
);