// -*- C++ -*-
// regex utils for the C++ library testsuite.
//
-// Copyright (C) 2012-2013 Free Software Foundation, Inc.
+// Copyright (C) 2012-2020 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// <http://www.gnu.org/licenses/>.
//
+#ifndef _TESTSUITE_REGEX_H
+#define _TESTSUITE_REGEX_H 1
+
#include <regex>
#include <stdexcept>
#include <iostream>
-#ifndef _TESTSUITE_REGEX_H
-#define _TESTSUITE_REGEX_H 1
-
namespace __gnu_test
{
// Test on a compilation of simple expressions, throw regex_error on error.
show_regex_error_codes();
cout << "regex_error::code " << regex_error_codes[e.code()] << endl;
-
+
if (__error != regex_error_internal)
{
// Then expected error_type is __error. Check.
// regex_match_debug behaves like regex_match, but will run *two* executors
// (if there's no back-reference) and check if their results agree. If not,
- // an exception throws. One can use them just in the way of using regex_match.
+ // an exception is thrown. The arguments are the same as for regex_match.
template<typename _Bi_iter, typename _Alloc,
typename _Ch_type, typename _Rx_traits>
bool
// __m is unspecified if return value is false.
if (__res1 == __res2 && (!__res1 || __m == __mm))
return __res1;
- throw(std::exception());
+ throw std::exception();
}
// No match_results version