Commit 849cab7b by Stephen M. Webb Committed by Stephen M. Webb

Initial regex implementation.

2010-06-25  Stephen M. Webb  <stephen.webb@bregmasoft.ca>

  Initial regex implementation.

  * include/std/regex: Modified to use bits/regex_* headers.
  * include/bits/regex_compiler.h: New file.
  * include/bits/regex_constants.h: New file.
  * include/bits/regex_cursor.h: New file.
  * include/bits/regex_error.h: New file.
  * include/bits/regex_grep_matcher.h: New file.
  * include/bits/regex_grep_matcher.tcc: New file.
  * include/bits/regex.h: New file.
  * include/bits/regex_nfa.h: New file.
  * include/bits/regex_nfa.tcc: New file.
  * include/Makefile.am: Added above new files.
  * include/Makefile.in: Regenerated.
  * testsuite/28_regex/02_definitions: New file.
  * testsuite/28_regex/03_requirements: New file.
  * testsuite/28_regex/03_requirements/typedefs.cc: New file.
  * testsuite/28_regex/04_header: New file.
  * testsuite/28_regex/04_header/regex: New file.
  * testsuite/28_regex/04_header/regex/std_c++0x_neg.cc: New file.
  * testsuite/28_regex/05_constants: New file.
  * testsuite/28_regex/05_constants/error_type.cc: New file.
  * testsuite/28_regex/05_constants/match_flag_type.cc: New file.
  * testsuite/28_regex/05_constants/syntax_option_type.cc: New file.
  * testsuite/28_regex/06_exception_type: New file.
  * testsuite/28_regex/06_exception_type/regex_error.cc: New file.
  * testsuite/28_regex/07_traits: New file.
  * testsuite/28_regex/07_traits/char: New file.
  * testsuite/28_regex/07_traits/char/ctor.cc: New file.
  * testsuite/28_regex/07_traits/char/isctype.cc: New file.
  * testsuite/28_regex/07_traits/char/length.cc: New file.
  * testsuite/28_regex/07_traits/char/lookup_classname.cc: New file.
  * testsuite/28_regex/07_traits/char/lookup_collatename.cc: New file.
  * testsuite/28_regex/07_traits/char/transform.cc: New file.
  * testsuite/28_regex/07_traits/char/transform_primary.cc: New file.
  * testsuite/28_regex/07_traits/char/translate.cc: New file.
  * testsuite/28_regex/07_traits/char/translate_nocase.cc: New file.
  * testsuite/28_regex/07_traits/char/value.cc: New file.
  * testsuite/28_regex/07_traits/wchar_t: New file.
  * testsuite/28_regex/07_traits/wchar_t/ctor.cc: New file.
  * testsuite/28_regex/07_traits/wchar_t/length.cc: New file.
  * testsuite/28_regex/07_traits/wchar_t/transform.cc: New file.
  * testsuite/28_regex/07_traits/wchar_t/translate.cc: New file.
  * testsuite/28_regex/07_traits/wchar_t/translate_nocase.cc: New file.
  * testsuite/28_regex/07_traits/wchar_t/value.cc: New file.
  * testsuite/28_regex/08_basic_regex: New file.
  * testsuite/28_regex/08_basic_regex/assign: New file.
  * testsuite/28_regex/08_basic_regex/assign/char: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/cstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/cstring_op.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/moveable.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/pstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/range.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/string.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/char/string_op.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t/cstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t/cstring_op.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t/pstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t/range.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t/string.cc: New file.
  * testsuite/28_regex/08_basic_regex/assign/wchar_t/string_op.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors: New file.
  * testsuite/28_regex/08_basic_regex/ctors/basic: New file.
  * testsuite/28_regex/08_basic_regex/ctors/basic/cstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/basic/pstring_char.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/basic/pstring_wchar_t.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/basic/string_range_01_02_03.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/cstring_awk.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/cstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/cstring_ecma.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/cstring_egrep.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/cstring_grep.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/default.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/char/range.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/copy_char.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/extended: New file.
  * testsuite/28_regex/08_basic_regex/ctors/extended/cstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/extended/string_range_01_02_03.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/move_char.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/string_char.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/string_wchar_t.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/wchar_t: New file.
  * testsuite/28_regex/08_basic_regex/ctors/wchar_t/cstring.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/wchar_t/default.cc: New file.
  * testsuite/28_regex/08_basic_regex/ctors/wchar_t/range.cc: New file.
  * testsuite/28_regex/08_basic_regex/regex.cc: New file.
  * testsuite/28_regex/09_sub_match: New file.
  * testsuite/28_regex/09_sub_match/cast_char.cc: New file.
  * testsuite/28_regex/09_sub_match/cast_wchar_t.cc: New file.
  * testsuite/28_regex/09_sub_match/length.cc: New file.
  * testsuite/28_regex/09_sub_match/typedefs.cc: New file.
  * testsuite/28_regex/10_match_results: New file.
  * testsuite/28_regex/10_match_results/ctors: New file.
  * testsuite/28_regex/10_match_results/ctors/char: New file.
  * testsuite/28_regex/10_match_results/ctors/char/default.cc: New file.
  * testsuite/28_regex/10_match_results/ctors/wchar_t: New file.
  * testsuite/28_regex/10_match_results/ctors/wchar_t/default.cc: New file.
  * testsuite/28_regex/10_match_results/typedefs.cc: New file.
  * testsuite/28_regex/11_algorithms: New file.
  * testsuite/28_regex/11_algorithms/02_match: New file.
  * testsuite/28_regex/11_algorithms/02_match/basic: New file.
  * testsuite/28_regex/11_algorithms/02_match/basic/string_01.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/basic/string_range_00_03.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/basic/string_range_01_03.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/basic/string_range_02_03.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended/cstring_plus.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended/cstring_questionmark.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended/string_any.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended/string_range_00_03.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended/string_range_01_03.cc: New file.
  * testsuite/28_regex/11_algorithms/02_match/extended/string_range_02_03.cc: New file.
  * testsuite/28_regex/12_iterators: New file.
  * testsuite/28_regex/12_iterators/regex_iterator: New file.
  * testsuite/28_regex/12_iterators/regex_iterator/ctors: New file.
  * testsuite/28_regex/12_iterators/regex_iterator/ctors/char: New file.
  * testsuite/28_regex/12_iterators/regex_iterator/ctors/char/default.cc: New file.
  * testsuite/28_regex/12_iterators/regex_iterator/ctors/wchar_t: New file.
  * testsuite/28_regex/12_iterators/regex_iterator/ctors/wchar_t/default.cc: New file.
  * testsuite/28_regex/12_iterators/regex_iterator/typedefs.cc: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator/ctors: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator/ctors/char: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator/ctors/char/default.cc: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator/ctors/wchar_t: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator/ctors/wchar_t/default.cc: New file.
  * testsuite/28_regex/12_iterators/regex_token_iterator/typedefs.cc: New file.
  * testsuite/28_regex/13_ecmascript: New file.

From-SVN: r161410
parent 58fc89f6
2010-06-25 Stephen M. Webb <stephen.webb@bregmasoft.ca>
Initial regex implementation.
* include/std/regex: Modified to use bits/regex_* headers.
* include/bits/regex_compiler.h: New file.
* include/bits/regex_constants.h: New file.
* include/bits/regex_cursor.h: New file.
* include/bits/regex_error.h: New file.
* include/bits/regex_grep_matcher.h: New file.
* include/bits/regex_grep_matcher.tcc: New file.
* include/bits/regex.h: New file.
* include/bits/regex_nfa.h: New file.
* include/bits/regex_nfa.tcc: New file.
* include/Makefile.am: Added above new files.
* include/Makefile.in: Regenerated.
* testsuite/28_regex/02_definitions: New file.
* testsuite/28_regex/03_requirements: New file.
* testsuite/28_regex/03_requirements/typedefs.cc: New file.
* testsuite/28_regex/04_header: New file.
* testsuite/28_regex/04_header/regex: New file.
* testsuite/28_regex/04_header/regex/std_c++0x_neg.cc: New file.
* testsuite/28_regex/05_constants: New file.
* testsuite/28_regex/05_constants/error_type.cc: New file.
* testsuite/28_regex/05_constants/match_flag_type.cc: New file.
* testsuite/28_regex/05_constants/syntax_option_type.cc: New file.
* testsuite/28_regex/06_exception_type: New file.
* testsuite/28_regex/06_exception_type/regex_error.cc: New file.
* testsuite/28_regex/07_traits: New file.
* testsuite/28_regex/07_traits/char: New file.
* testsuite/28_regex/07_traits/char/ctor.cc: New file.
* testsuite/28_regex/07_traits/char/isctype.cc: New file.
* testsuite/28_regex/07_traits/char/length.cc: New file.
* testsuite/28_regex/07_traits/char/lookup_classname.cc: New file.
* testsuite/28_regex/07_traits/char/lookup_collatename.cc: New file.
* testsuite/28_regex/07_traits/char/transform.cc: New file.
* testsuite/28_regex/07_traits/char/transform_primary.cc: New file.
* testsuite/28_regex/07_traits/char/translate.cc: New file.
* testsuite/28_regex/07_traits/char/translate_nocase.cc: New file.
* testsuite/28_regex/07_traits/char/value.cc: New file.
* testsuite/28_regex/07_traits/wchar_t: New file.
* testsuite/28_regex/07_traits/wchar_t/ctor.cc: New file.
* testsuite/28_regex/07_traits/wchar_t/length.cc: New file.
* testsuite/28_regex/07_traits/wchar_t/transform.cc: New file.
* testsuite/28_regex/07_traits/wchar_t/translate.cc: New file.
* testsuite/28_regex/07_traits/wchar_t/translate_nocase.cc: New file.
* testsuite/28_regex/07_traits/wchar_t/value.cc: New file.
* testsuite/28_regex/08_basic_regex: New file.
* testsuite/28_regex/08_basic_regex/assign: New file.
* testsuite/28_regex/08_basic_regex/assign/char: New file.
* testsuite/28_regex/08_basic_regex/assign/char/cstring.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/char/cstring_op.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/char/moveable.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/char/pstring.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/char/range.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/char/string.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/char/string_op.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t/cstring.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t/cstring_op.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t/pstring.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t/range.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t/string.cc: New file.
* testsuite/28_regex/08_basic_regex/assign/wchar_t/string_op.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors: New file.
* testsuite/28_regex/08_basic_regex/ctors/basic: New file.
* testsuite/28_regex/08_basic_regex/ctors/basic/cstring.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/basic/pstring_char.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/basic/pstring_wchar_t.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/basic/string_range_01_02_03.cc:
New file.
* testsuite/28_regex/08_basic_regex/ctors/char: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/cstring_awk.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/cstring.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/cstring_ecma.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/cstring_egrep.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/cstring_grep.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/default.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/char/range.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/copy_char.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/extended: New file.
* testsuite/28_regex/08_basic_regex/ctors/extended/cstring.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/extended/string_range_01_02_03.cc:
New file.
* testsuite/28_regex/08_basic_regex/ctors/move_char.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/string_char.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/string_wchar_t.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/wchar_t: New file.
* testsuite/28_regex/08_basic_regex/ctors/wchar_t/cstring.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/wchar_t/default.cc: New file.
* testsuite/28_regex/08_basic_regex/ctors/wchar_t/range.cc: New file.
* testsuite/28_regex/08_basic_regex/regex.cc: New file.
* testsuite/28_regex/09_sub_match: New file.
* testsuite/28_regex/09_sub_match/cast_char.cc: New file.
* testsuite/28_regex/09_sub_match/cast_wchar_t.cc: New file.
* testsuite/28_regex/09_sub_match/length.cc: New file.
* testsuite/28_regex/09_sub_match/typedefs.cc: New file.
* testsuite/28_regex/10_match_results: New file.
* testsuite/28_regex/10_match_results/ctors: New file.
* testsuite/28_regex/10_match_results/ctors/char: New file.
* testsuite/28_regex/10_match_results/ctors/char/default.cc: New file.
* testsuite/28_regex/10_match_results/ctors/wchar_t: New file.
* testsuite/28_regex/10_match_results/ctors/wchar_t/default.cc: New file.
* testsuite/28_regex/10_match_results/typedefs.cc: New file.
* testsuite/28_regex/11_algorithms: New file.
* testsuite/28_regex/11_algorithms/02_match: New file.
* testsuite/28_regex/11_algorithms/02_match/basic: New file.
* testsuite/28_regex/11_algorithms/02_match/basic/string_01.cc: New file.
* testsuite/28_regex/11_algorithms/02_match/basic/string_range_00_03.cc:
New file.
* testsuite/28_regex/11_algorithms/02_match/basic/string_range_01_03.cc:
New file.
* testsuite/28_regex/11_algorithms/02_match/basic/string_range_02_03.cc:
New file.
* testsuite/28_regex/11_algorithms/02_match/extended: New file.
* testsuite/28_regex/11_algorithms/02_match/extended/cstring_plus.cc: New file.
* testsuite/28_regex/11_algorithms/02_match/extended/cstring_questionmark.cc:
New file.
* testsuite/28_regex/11_algorithms/02_match/extended/string_any.cc: New file.
* testsuite/28_regex/11_algorithms/02_match/extended/string_range_00_03.cc:
New file.
* testsuite/28_regex/11_algorithms/02_match/extended/string_range_01_03.cc:
New file.
* testsuite/28_regex/11_algorithms/02_match/extended/string_range_02_03.cc:
New file.
* testsuite/28_regex/12_iterators: New file.
* testsuite/28_regex/12_iterators/regex_iterator: New file.
* testsuite/28_regex/12_iterators/regex_iterator/ctors: New file.
* testsuite/28_regex/12_iterators/regex_iterator/ctors/char: New file.
* testsuite/28_regex/12_iterators/regex_iterator/ctors/char/default.cc: New
file.
* testsuite/28_regex/12_iterators/regex_iterator/ctors/wchar_t: New file.
* testsuite/28_regex/12_iterators/regex_iterator/ctors/wchar_t/default.cc: New
file.
* testsuite/28_regex/12_iterators/regex_iterator/typedefs.cc: New file.
* testsuite/28_regex/12_iterators/regex_token_iterator: New file.
* testsuite/28_regex/12_iterators/regex_token_iterator/ctors: New file.
* testsuite/28_regex/12_iterators/regex_token_iterator/ctors/char: New file.
* testsuite/28_regex/12_iterators/regex_token_iterator/ctors/char/default.cc:
New file.
* testsuite/28_regex/12_iterators/regex_token_iterator/ctors/wchar_t: New file.
* testsuite/28_regex/12_iterators/regex_token_iterator/ctors/wchar_t/default.cc:
New file.
* testsuite/28_regex/12_iterators/regex_token_iterator/typedefs.cc: New file.
* testsuite/28_regex/13_ecmascript: New file.
2010-06-25 Paolo Carlini <paolo.carlini@oracle.com>
* include/profile/impl/profiler_list_to_slist.h: Remove spurious
......
......@@ -121,6 +121,15 @@ bits_headers = \
${bits_srcdir}/postypes.h \
${bits_srcdir}/random.h \
${bits_srcdir}/random.tcc \
${bits_srcdir}/regex.h \
${bits_srcdir}/regex_compiler.h \
${bits_srcdir}/regex_constants.h \
${bits_srcdir}/regex_cursor.h \
${bits_srcdir}/regex_error.h \
${bits_srcdir}/regex_grep_matcher.h \
${bits_srcdir}/regex_grep_matcher.tcc \
${bits_srcdir}/regex_nfa.h \
${bits_srcdir}/regex_nfa.tcc \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \
......
......@@ -361,6 +361,15 @@ bits_headers = \
${bits_srcdir}/postypes.h \
${bits_srcdir}/random.h \
${bits_srcdir}/random.tcc \
${bits_srcdir}/regex.h \
${bits_srcdir}/regex_compiler.h \
${bits_srcdir}/regex_constants.h \
${bits_srcdir}/regex_cursor.h \
${bits_srcdir}/regex_error.h \
${bits_srcdir}/regex_grep_matcher.h \
${bits_srcdir}/regex_grep_matcher.tcc \
${bits_srcdir}/regex_nfa.h \
${bits_srcdir}/regex_nfa.tcc \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \
......
// class template regex -*- C++ -*-
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/**
* @file bits/regex_cursor.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
namespace __regex
{
// ABC for pattern matching
struct _PatternCursor
{
virtual ~_PatternCursor() { };
virtual void _M_next() = 0;
virtual bool _M_at_end() const = 0;
};
// Provides a cursor into the specific target string.
template<typename _FwdIterT>
class _SpecializedCursor
: public _PatternCursor
{
public:
_SpecializedCursor(const _FwdIterT& __b, const _FwdIterT __e)
: _M_b(__b), _M_c(__b), _M_e(__e)
{ }
typename std::iterator_traits<_FwdIterT>::value_type
_M_current() const
{ return *_M_c; }
void
_M_next()
{ ++_M_c; }
_FwdIterT
_M_pos() const
{ return _M_c; }
const _FwdIterT&
_M_begin() const
{ return _M_b; }
const _FwdIterT&
_M_end() const
{ return _M_e; }
bool
_M_at_end() const
{ return _M_c == _M_e; }
private:
_FwdIterT _M_b;
_FwdIterT _M_c;
_FwdIterT _M_e;
};
// Helper funxtion to create a cursor specialized for an iterator class.
template<typename _FwdIterT>
_SpecializedCursor<_FwdIterT>
__cursor(const _FwdIterT& __b, const _FwdIterT __e)
{ return _SpecializedCursor<_FwdIterT>(__b, __e); }
} // namespace __regex
} // namespace std
/* vim: set ts=8 sw=2 sts=2: */
// class template regex -*- C++ -*-
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/**
* @file bits/regex_error
* @brief Error and exception objects for the std regex library.
*
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
namespace regex_constants
{
/**
* @name 5.3 Error Types
*/
//@{
enum error_type
{
_S_error_collate,
_S_error_ctype,
_S_error_escape,
_S_error_backref,
_S_error_brack,
_S_error_paren,
_S_error_brace,
_S_error_badbrace,
_S_error_range,
_S_error_space,
_S_error_badrepeat,
_S_error_complexity,
_S_error_stack,
_S_error_last
};
/** The expression contained an invalid collating element name. */
static const error_type error_collate(_S_error_collate);
/** The expression contained an invalid character class name. */
static const error_type error_ctype(_S_error_ctype);
/**
* The expression contained an invalid escaped character, or a trailing
* escape.
*/
static const error_type error_escape(_S_error_escape);
/** The expression contained an invalid back reference. */
static const error_type error_backref(_S_error_backref);
/** The expression contained mismatched [ and ]. */
static const error_type error_brack(_S_error_brack);
/** The expression contained mismatched ( and ). */
static const error_type error_paren(_S_error_paren);
/** The expression contained mismatched { and } */
static const error_type error_brace(_S_error_brace);
/** The expression contained an invalid range in a {} expression. */
static const error_type error_badbrace(_S_error_badbrace);
/**
* The expression contained an invalid character range,
* such as [b-a] in most encodings.
*/
static const error_type error_range(_S_error_range);
/**
* There was insufficient memory to convert the expression into a
* finite state machine.
*/
static const error_type error_space(_S_error_space);
/**
* One of <em>*?+{<em> was not preceded by a valid regular expression.
*/
static const error_type error_badrepeat(_S_error_badrepeat);
/**
* The complexity of an attempted match against a regular expression
* exceeded a pre-set level.
*/
static const error_type error_complexity(_S_error_complexity);
/**
* There was insufficient memory to determine whether the
* regular expression could match the specified character sequence.
*/
static const error_type error_stack(_S_error_stack);
//@}
}
// [7.8] Class regex_error
/**
* @brief A regular expression exception class.
* @ingroup exceptions
*
* The regular expression library throws objects of this class on error.
*/
class regex_error
: public std::runtime_error
{
public:
/**
* @brief Constructs a regex_error object.
*
* @param ecode the regex error code.
*/
explicit
regex_error(regex_constants::error_type __ecode)
: std::runtime_error("regex_error"), _M_code(__ecode)
{ }
/**
* @brief Gets the regex error code.
*
* @returns the regex error code.
*/
regex_constants::error_type
code() const
{ return _M_code; }
protected:
regex_constants::error_type _M_code;
};
inline void
__throw_regex_error(regex_constants::error_type __ecode)
{ throw regex_error(__ecode); }
} // namespace std
// class template regex -*- C++ -*-
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/**
* @file bits/regex_executor.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
namespace std
{
template<typename _BiIter>
class sub_match;
template<typename _Bi_iter, typename _Allocator>
class match_results;
namespace __regex
{
// A _Results facade specialized for wrapping a templated sub_match.
template<typename _FwdIterT, typename _Alloc>
class _SpecializedResults
: public _Results
{
public:
_SpecializedResults(const _Automaton::_SizeT __size,
const _SpecializedCursor<_FwdIterT>& __cursor,
match_results<_FwdIterT, _Alloc>& __m);
void
_M_set_pos(int __i, int __j, const _PatternCursor& __pc);
void
_M_set_matched(int __i, bool __is_matched)
{ _M_results.at(__i).matched = __is_matched; }
private:
match_results<_FwdIterT, _Alloc>& _M_results;
};
template<typename _FwdIterT, typename _Alloc>
_SpecializedResults<_FwdIterT, _Alloc>::
_SpecializedResults(const _Automaton::_SizeT __size,
const _SpecializedCursor<_FwdIterT>& __cursor,
match_results<_FwdIterT, _Alloc>& __m)
: _M_results(__m)
{
typedef typename match_results<_FwdIterT, _Alloc>::size_type size_type;
_M_results.clear();
std::sub_match<_FwdIterT> __sm;
__sm.matched = false;
size_type __result_count = __size + 2;
for (size_type __i = 0; __i < __result_count; ++__i)
_M_results.push_back(__sm);
_M_results.at(__size+0).first = __cursor._M_begin();
_M_results.at(__size+0).second = __cursor._M_begin();
_M_results.at(__size+1).first = __cursor._M_end();
_M_results.at(__size+1).second = __cursor._M_end();
}
template<typename _FwdIterT, typename _Alloc>
void
_SpecializedResults<_FwdIterT, _Alloc>::
_M_set_pos(int __i, int __j, const _PatternCursor& __pc)
{
typedef const _SpecializedCursor<_FwdIterT>& _CursorT;
_CursorT __c = static_cast<_CursorT>(__pc);
if (__j == 0)
_M_results.at(__i).first = __c._M_pos();
else
_M_results.at(__i).second = __c._M_pos()+1;
}
// A stack of states used in evaluating the NFA.
typedef std::stack<_StateIdT, std::vector<_StateIdT> > _StateStack;
// Executes a regular expression NFA/DFA over a range using a variant of
// the parallel execution algorithm featured in the grep utility, modified
// to use Laurikari tags.
class _Grep_matcher
{
public:
_Grep_matcher(_PatternCursor& __p,
_Results& __r,
const _AutomatonPtr& __automaton,
regex_constants::match_flag_type __flags);
private:
_StateSet
_M_e_closure(_StateIdT __i);
_StateSet
_M_e_closure(const _StateSet& __s);
_StateSet
_M_e_closure(_StateStack& __stack, const _StateSet& __s);
private:
const std::shared_ptr<_Nfa> _M_nfa;
_PatternCursor& _M_pattern;
_Results& _M_results;
};
} // namespace __regex
} // namespace std
#include <bits/regex_grep_matcher.tcc>
/* vim: set ts=8 sw=2 sts=2: */
// class template regex -*- C++ -*-
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/**
* @file regex_grep_matcher.cc
*/
#include <regex>
namespace std
{
namespace
{
// A stack of states used in evaluating the NFA.
typedef std::stack<
std::__regex::_StateIdT,
std::vector<std::__regex::_StateIdT>
> _StateStack;
// Obtains the next state set given the current state set __s and the current
// input character.
inline std::__regex::_StateSet
__move(const std::__regex::_PatternCursor& __p,
const std::__regex::_Nfa& __nfa,
const std::__regex::_StateSet& __s)
{
std::__regex::_StateSet __m;
for (std::__regex::_StateSet::const_iterator __i = __s.begin();
__i != __s.end(); ++__i)
{
if (*__i == std::__regex::_S_invalid_state_id)
continue;
const std::__regex::_State& __state = __nfa[*__i];
if (__state._M_opcode == std::__regex::_S_opcode_match
&& __state._M_matches(__p))
__m.insert(__state._M_next);
}
return __m;
}
// returns true if (__s intersect __t) is not empty
inline bool
__includes_some(const std::__regex::_StateSet& __s,
const std::__regex::_StateSet& __t)
{
if (__s.size() > 0 && __t.size() > 0)
{
std::__regex::_StateSet::const_iterator __first = __s.begin();
std::__regex::_StateSet::const_iterator __second = __t.begin();
while (__first != __s.end() && __second != __t.end())
{
if (*__first < *__second)
++__first;
else if (*__second < *__first)
++__second;
else
return true;
}
}
return false;
}
// If an identified state __u is not already in the current state set __e,
// insert it and push it on the current state stack __s.
inline void
__add_visited_state(const std::__regex::_StateIdT __u,
_StateStack& __s,
std::__regex::_StateSet& __e)
{
if (__e.count(__u) == 0)
{
__e.insert(__u);
__s.push(__u);
}
}
} // anonymous namespace
namespace __regex
{
inline _Grep_matcher::
_Grep_matcher(_PatternCursor& __p,
_Results& __r,
const _AutomatonPtr& __nfa,
regex_constants::match_flag_type __flags)
: _M_nfa(static_pointer_cast<_Nfa>(__nfa)), _M_pattern(__p), _M_results(__r)
{
__regex::_StateSet __t = this->_M_e_closure(_M_nfa->_M_start());
for (; !_M_pattern._M_at_end(); _M_pattern._M_next())
__t = this->_M_e_closure(__move(_M_pattern, *_M_nfa, __t));
_M_results._M_set_matched(0,
__includes_some(_M_nfa->_M_final_states(), __t));
}
// Creates the e-closure set for the initial state __i.
inline _StateSet _Grep_matcher::
_M_e_closure(_StateIdT __i)
{
_StateSet __s;
__s.insert(__i);
_StateStack __stack;
__stack.push(__i);
return this->_M_e_closure(__stack, __s);
}
// Creates the e-closure set for an arbitrary state set __s.
inline _StateSet _Grep_matcher::
_M_e_closure(const _StateSet& __s)
{
_StateStack __stack;
for (_StateSet::const_iterator __i = __s.begin(); __i != __s.end(); ++__i)
__stack.push(*__i);
return this->_M_e_closure(__stack, __s);
}
inline _StateSet _Grep_matcher::
_M_e_closure(_StateStack& __stack, const _StateSet& __s)
{
_StateSet __e = __s;
while (!__stack.empty())
{
_StateIdT __t = __stack.top(); __stack.pop();
if (__t == _S_invalid_state_id)
continue;
// for each __u with edge from __t to __u labeled e do ...
const _State& __state = _M_nfa->operator[](__t);
switch (__state._M_opcode)
{
case _S_opcode_alternative:
__add_visited_state(__state._M_next, __stack, __e);
__add_visited_state(__state._M_alt, __stack, __e);
break;
case _S_opcode_subexpr_begin:
__add_visited_state(__state._M_next, __stack, __e);
__state._M_tagger(_M_pattern, _M_results);
break;
case _S_opcode_subexpr_end:
__add_visited_state(__state._M_next, __stack, __e);
__state._M_tagger(_M_pattern, _M_results);
_M_results._M_set_matched(__state._M_subexpr, true);
break;
case _S_opcode_accept:
__add_visited_state(__state._M_next, __stack, __e);
break;
default:
break;
}
}
return __e;
}
} // namespace __regex
} // namespace std
/* vim: set ts=8 sw=2 sts=2: */
// class template regex -*- C++ -*-
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/**
* @file regex_nfa.cc
*/
#include <regex>
namespace std
{
namespace __regex
{
#ifdef _GLIBCXX_DEBUG
inline std::ostream& _State::
_M_print(std::ostream& ostr) const
{
switch (_M_opcode)
{
case _S_opcode_alternative:
ostr << "alt next=" << _M_next << " alt=" << _M_alt;
break;
case _S_opcode_subexpr_begin:
ostr << "subexpr begin next=" << _M_next << " index=" << _M_subexpr;
break;
case _S_opcode_subexpr_end:
ostr << "subexpr end next=" << _M_next << " index=" << _M_subexpr;
break;
case _S_opcode_match:
ostr << "match next=" << _M_next;
break;
case _S_opcode_accept:
ostr << "accept next=" << _M_next;
break;
default:
ostr << "unknown next=" << _M_next;
break;
}
return ostr;
}
// Prints graphviz dot commands for state.
inline std::ostream& _State::
_M_dot(std::ostream& __ostr, _StateIdT __id) const
{
switch (_M_opcode)
{
case _S_opcode_alternative:
__ostr << __id << " [label=\"" << __id << "\\nALT\"];\n"
<< __id << " -> " << _M_next
<< " [label=\"epsilon\", tailport=\"s\"];\n"
<< __id << " -> " << _M_alt
<< " [label=\"epsilon\", tailport=\"n\"];\n";
break;
case _S_opcode_subexpr_begin:
__ostr << __id << " [label=\"" << __id << "\\nSBEGIN "
<< _M_subexpr << "\"];\n"
<< __id << " -> " << _M_next << " [label=\"epsilon\"];\n";
break;
case _S_opcode_subexpr_end:
__ostr << __id << " [label=\"" << __id << "\\nSEND "
<< _M_subexpr << "\"];\n"
<< __id << " -> " << _M_next << " [label=\"epsilon\"];\n";
break;
case _S_opcode_match:
__ostr << __id << " [label=\"" << __id << "\\nMATCH\"];\n"
<< __id << " -> " << _M_next << " [label=\"<match>\"];\n";
break;
case _S_opcode_accept:
__ostr << __id << " [label=\"" << __id << "\\nACC\"];\n" ;
break;
default:
__ostr << __id << " [label=\"" << __id << "\\nUNK\"];\n"
<< __id << " -> " << _M_next << " [label=\"?\"];\n";
break;
}
return __ostr;
}
inline std::ostream& _Nfa::
_M_dot(std::ostream& __ostr) const
{
__ostr << "digraph _Nfa {\n"
<< " rankdir=LR;\n";
for (unsigned int __i = 0; __i < this->size(); ++__i)
{ this->at(__i)._M_dot(__ostr, __i); }
__ostr << "}\n";
return __ostr;
}
#endif
inline _StateSeq& _StateSeq::
operator=(const _StateSeq& __rhs)
{
_M_start = __rhs._M_start;
_M_end1 = __rhs._M_end1;
_M_end2 = __rhs._M_end2;
return *this;
}
inline void _StateSeq::
_M_push_back(_StateIdT __id)
{
if (_M_end1 != _S_invalid_state_id)
_M_nfa[_M_end1]._M_next = __id;
_M_end1 = __id;
}
inline void _StateSeq::
_M_append(_StateIdT __id)
{
if (_M_end2 != _S_invalid_state_id)
{
if (_M_end2 == _M_end1)
_M_nfa[_M_end2]._M_alt = __id;
else
_M_nfa[_M_end2]._M_next = __id;
_M_end2 = _S_invalid_state_id;
}
if (_M_end1 != _S_invalid_state_id)
_M_nfa[_M_end1]._M_next = __id;
_M_end1 = __id;
}
inline void _StateSeq::
_M_append(_StateSeq& __rhs)
{
if (_M_end2 != _S_invalid_state_id)
{
if (_M_end2 == _M_end1)
_M_nfa[_M_end2]._M_alt = __rhs._M_start;
else
_M_nfa[_M_end2]._M_next = __rhs._M_start;
_M_end2 = _S_invalid_state_id;
}
if (__rhs._M_end2 != _S_invalid_state_id)
_M_end2 = __rhs._M_end2;
if (_M_end1 != _S_invalid_state_id)
_M_nfa[_M_end1]._M_next = __rhs._M_start;
_M_end1 = __rhs._M_end1;
}
// @todo implement this function.
inline _StateIdT _StateSeq::
_M_clone()
{ return 0; }
} // namespace __regex
} // namespace std
......@@ -35,33 +35,30 @@
# include <bits/c++0x_warning.h>
#else
#if defined(_GLIBCXX_INCLUDE_AS_TR1)
# error C++0x header cannot be included from TR1 header
#endif
#include <algorithm>
#include <bitset>
#include <functional>
#ifdef _GLIBCXX_DEBUG
# include <iosfwd>
#endif
#include <iterator>
#include <locale>
#include <memory>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <string>
#include <vector>
#include <utility>
#include <sstream>
#include <vector>
#if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
# include <tr1_impl/regex>
#else
# define _GLIBCXX_INCLUDE_AS_CXX0X
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
# define _GLIBCXX_TR1
# include <tr1_impl/regex>
# undef _GLIBCXX_TR1
# undef _GLIBCXX_END_NAMESPACE_TR1
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
#include <bits/regex_constants.h>
#include <bits/regex_error.h>
#include <bits/regex_cursor.h>
#include <bits/regex_nfa.h>
#include <bits/regex_compiler.h>
#include <bits/regex_grep_matcher.h>
#include <bits/regex.h>
#endif // __GXX_EXPERIMENTAL_CXX0X__
......
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
#include <regex>
void
test01()
{
typedef std::regex_traits<char> traits;
typedef traits::char_type char_type;
typedef traits::string_type string_type;
typedef traits::locale_type locale_type;
typedef traits::char_class_type char_class_type;
}
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// Copyright (C) 2007, 2009, 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <regex> // { dg-excess-errors "In file included from" }
// { dg-options "-std=c++0x" }
// { dg-do compile }
//
// 2009-06-17 Stephen M. Webb <stephen.webb@xandros.com>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.5.3
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_constants::error_type err __attribute__((unused));
err = std::regex_constants::error_collate;
err = std::regex_constants::error_ctype;
err = std::regex_constants::error_escape;
err = std::regex_constants::error_backref;
err = std::regex_constants::error_brack;
err = std::regex_constants::error_paren;
err = std::regex_constants::error_brace;
err = std::regex_constants::error_badbrace;
err = std::regex_constants::error_range;
err = std::regex_constants::error_space;
err = std::regex_constants::error_badrepeat;
err = std::regex_constants::error_complexity;
err = std::regex_constants::error_stack;
}
int main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do compile }
//
// 2009-06-17 Stephen M. Webb <stephen.webb@xandros.com>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.5.1
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_constants::match_flag_type flag = std::regex_constants::match_default;
flag |= std::regex_constants::match_not_bol;
flag |= std::regex_constants::match_not_eol;
flag |= std::regex_constants::match_not_bow;
flag |= std::regex_constants::match_not_eow;
flag |= std::regex_constants::match_any;
flag |= std::regex_constants::match_not_null;
flag |= std::regex_constants::match_continuous;
flag |= std::regex_constants::match_prev_avail;
flag |= std::regex_constants::format_default;
flag |= std::regex_constants::format_sed;
flag |= std::regex_constants::format_no_copy;
flag |= std::regex_constants::format_first_only;
}
int main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do compile }
//
// 2009-06-17 Stephen M. Webb <stephen.webb@xandros.com>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.5.1
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_constants::syntax_option_type option = 0;
option |= std::regex_constants::icase;
option |= std::regex_constants::nosubs;
option |= std::regex_constants::optimize;
option |= std::regex_constants::collate;
option |= std::regex_constants::ECMAScript;
option |= std::regex_constants::basic;
option |= std::regex_constants::extended;
option |= std::regex_constants::awk;
option |= std::regex_constants::grep;
option |= std::regex_constants::egrep;
}
int main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do compile }
//
// 2009-06-17 Stephen M. Webb <stephen.webb@xandros.com>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.6 [re.badexp]
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_error error(std::regex_constants::error_collate);
VERIFY(error.code() == std::regex_constants::error_collate);
try
{
throw error;
}
catch (std::runtime_error& ex)
{
}
}
int main()
{
test01();
return 0;
}
// { dg-do link }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.7] class template regex_traits
#include <regex>
#include <testsuite_hooks.h>
// Tests default constructor of the regex_traits class. There is only the
// default constructor.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::regex_traits<char> test_type;
// required default constructor
test_type t;
// Check for required typedefs
typedef test_type::char_type char_type;
typedef test_type::string_type string_type;
typedef test_type::locale_type locale_type;
typedef test_type::char_class_type char_class_type;
}
int
main()
{
test01();
return 0;
};
// { dg-do run { xfail *-*-* } }
// { dg-options "-std=c++0x" }
//
// 2010-06-23 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2(4) Table 127 - Regular expression traits class requirements
// 28.7(11) Class template regex_traits [re.traits]
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
typedef std::regex_traits<CharT> traits;
char name[] = "lower";
traits t;
VERIFY( t.isctype('e', t.lookup_classname(name, name+sizeof(name)-1)) );
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
// 28.7 (3) static std::size_t length(const char_type* p);
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
typedef char CharT;
typedef std::regex_traits<CharT> traits;
bool test __attribute__((unused)) = true;
const CharT* p = "";
std::size_t i = traits::length(p);
VERIFY( i == 0 );
}
int main()
{
test01();
return 0;
}
// { dg-do run { xfail *-*-* } }
// { dg-options "-std=c++0x" }
//
// 2010-06-23 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2(4) Table 127 - Regular expression traits class requirements
// 28.7(9) Class template regex_traits [re.traits]
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
typedef std::regex_traits<CharT> traits;
char n1[] = "lower";
char n2[] = "alpha";
traits t;
traits::char_class_type c1 = t.lookup_classname(n1, n1+sizeof(n1)-1);
VERIFY( c1 != 0 );
traits::char_class_type c2 = t.lookup_classname(n1, n1+sizeof(n1)-1, true);
traits::char_class_type c3 = t.lookup_classname(n2, n2+sizeof(n2)-1, true);
VERIFY( c2 == c3 );
}
int main()
{
test01();
return 0;
}
// { dg-do run { xfail *-*-* } }
// { dg-options "-std=c++0x" }
//
// 2010-06-23 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 (8) Class template regex_traits [re.traits]
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
typedef std::regex_traits<CharT> traits;
char name[] = "ll";
traits t;
traits::string_type sname = t.lookup_collatename(name, name+sizeof(name)-1);
VERIFY( !sname.empty() );
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
#include <regex>
#include <string>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
typedef std::regex_traits<CharT> traits;
traits t;
traits::string_type G = "abc";
traits::string_type H = "def";
VERIFY( G < H );
VERIFY( t.transform(G.begin(), G.end()) < t.transform(H.begin(), H.end()) );
}
int main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
#include <regex>
#include <string>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
typedef std::regex_traits<CharT> traits;
traits t;
traits::string_type G = "abc";
traits::string_type H = "def";
traits::string_type J = "ABC";
VERIFY( G < H );
VERIFY( t.transform_primary(G.begin(), G.end()) < t.transform_primary(H.begin(), H.end()) );
VERIFY( G == H );
VERIFY( t.transform_primary(G.begin(), G.end()) == t.transform_primary(J.begin(), J.end()) );
}
int main()
{
test01();
return 0;
}
// { dg_do run }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
// 28.7 (3) static std::size_t length(const char_type* p);
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
std::regex_traits<CharT> t;
CharT c = 'a';
CharT d = 'a';
VERIFY( t.translate(c) == t.translate(d) );
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.7] class template regex_traits (5) translate_nocase
#include <regex>
#include <testsuite_hooks.h>
// Verifies the workings of the regex_traits translate_nocase function.
void test01()
{
bool test __attribute__((unused)) = true;
typedef char CharT;
std::regex_traits<CharT> t;
CharT c = 'a';
CharT C = 'A';
VERIFY( t.translate_nocase(c) == t.translate_nocase(C) );
}
int
main()
{
test01();
return 0;
};
// { dg-do run }
// { dg-options "-std=gnu++0x" }
// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.7] class template regex_traits value() function
#include <regex>
#include <testsuite_hooks.h>
// Tests the value() function of the regex_traits<char> class.
void test01()
{
bool test __attribute__((unused)) = true;
std::regex_traits<char> t;
VERIFY( t.value('7', 8) == 7 );
VERIFY( t.value('7', 10) == 7 );
VERIFY( t.value('7', 16) == 7 );
VERIFY( t.value('9', 8) == -1 );
VERIFY( t.value('9', 10) == 9 );
VERIFY( t.value('9', 16) == 9 );
VERIFY( t.value('d', 8) == -1 );
VERIFY( t.value('d', 10) == -1 );
VERIFY( t.value('d', 16) == 13 );
}
int
main()
{
test01();
return 0;
};
// { dg-do link }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.7] class template regex_traits
#include <regex>
#include <testsuite_hooks.h>
// Tests default constructor of the regex_traits class. There is only the
// default constructor.
void test01()
{
typedef std::regex_traits<wchar_t> test_type;
// required default constructor
test_type t;
// Check for required typedefs
typedef test_type::char_type char_type;
typedef test_type::string_type string_type;
typedef test_type::locale_type locale_type;
typedef test_type::char_class_type char_class_type;
}
int
main()
{
test01();
return 0;
};
// { dg-do run }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
// 28.7 (3) static std::size_t length(const char_type* p);
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
typedef wchar_t CharT;
typedef std::regex_traits<CharT> traits;
bool test __attribute__((unused)) = true;
const CharT* p = L"";
std::size_t i = traits::length(p);
VERIFY( i == 0 );
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
#include <regex>
#include <string>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef wchar_t CharT;
typedef std::regex_traits<CharT> traits;
traits t;
traits::string_type G = L"abc";
traits::string_type H = L"def";
VERIFY( G < H );
VERIFY( t.transform(G.begin(), G.end()) < t.transform(H.begin(), H.end()) );
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=c++0x" }
//
// 2010-02-17 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.3 Requirements [re.req]
// 28.2 (4) Table 127 - Regular expression traits class requirements
// 28.7 Class template regex_traits [re.traits]
// 28.7 (3) static std::size_t length(const char_type* p);
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef wchar_t CharT;
std::regex_traits<CharT> t;
CharT c = L'a';
CharT d = L'a';
VERIFY( t.translate(c) == t.translate(d) );
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.7] class template regex_traits (5) translate_nocase
#include <regex>
#include <testsuite_hooks.h>
// Verifies the workings of the regex_traits translate_nocase function.
void test01()
{
bool test __attribute__((unused)) = true;
typedef wchar_t CharT;
std::regex_traits<CharT> t;
CharT c = L'a';
CharT C = L'A';
VERIFY( t.translate_nocase(c) == t.translate_nocase(C) );
}
int
main()
{
test01();
return 0;
};
// { dg-do run }
// { dg-options "-std=gnu++0x" }
// 2008-08-11 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.7] class template regex_traits value() function
#include <regex>
#include <testsuite_hooks.h>
// Tests the value() function of the regex_traits<char> class.
void test01()
{
bool test __attribute__((unused)) = true;
std::regex_traits<char> t;
VERIFY( t.value('7', 8) == 7 );
VERIFY( t.value('7', 10) == 7 );
VERIFY( t.value('7', 16) == 7 );
VERIFY( t.value('9', 8) == -1 );
VERIFY( t.value('9', 10) == 9 );
VERIFY( t.value('9', 16) == 9 );
VERIFY( t.value('d', 8) == -1 );
VERIFY( t.value('d', 10) == -1 );
VERIFY( t.value('d', 16) == 13 );
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2009-06-05 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// C++0X [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests assign operation from a C-style null-terminated-string.
void test01()
{
bool test __attribute__((unused)) = true;
std::basic_regex<char> re;
const char* cs = "aab";
re.assign(cs);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests basic_regex assign operator from a C-style null-terminated-string.
void test01()
{
typedef std::basic_regex<char> test_type;
const char* cs = "aab";
test_type re;
re = cs;
}
int
main()
{
test01();
return 0;
};
// { dg-options "-std=gnu++0x" }
// 2010-07-07 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3](9-11) class template basic_regex assign
#include <regex>
#include <testsuite_hooks.h>
#include <utility>
// Tests assign operator of the basic_regex class for moveable rvalues.
void test01()
{
bool test __attribute__((unused)) = true;
std::regex src_re("aaba");
const unsigned mark_count = src_re.mark_count();
const std::regex::flag_type flags = src_re.flags();
std::regex target_re;
target_re.assign(std::move(src_re));
VERIFY( target_re.flags() == flags );
VERIFY( target_re.mark_count() == mark_count );
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests assign operation from a Pascal-style counted-string.
void test01()
{
typedef std::basic_regex<char> test_type;
const char cs[] = "aab";
test_type re;
re.assign(cs, sizeof(cs)-1, std::regex_constants::basic);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests range assign of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
char s[] = "a+b|c";
test_type re;
re.assign(s, s + 5);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <string>
#include <regex>
#include <testsuite_hooks.h>
// Tests C++ string assignment of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
std::string s("a*b");
test_type re;
re.assign(s);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <string>
#include <regex>
#include <testsuite_hooks.h>
// Tests basic_regex assignment operator from a C++ string;
void test01()
{
typedef std::basic_regex<char> test_type;
std::string s("a*b");
test_type re;
re = s;
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests assign operation from a C-style null-terminated-string.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
const wchar_t* cs = L"aab";
test_type re;
re.assign(cs);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests basic_regex assign operator from a C-style null-terminated-string.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
const wchar_t* cs = L"aab";
test_type re;
re = cs;
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests assign operation from a Pascal-style counted-string.
void test01()
{
typedef std::basic_regex<wchar_t> test_type;
const wchar_t cs[] = L"aab";
test_type re;
re.assign(cs, sizeof(cs)-1, std::regex_constants::basic);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <regex>
#include <testsuite_hooks.h>
// Tests range assign of the basic_regex class.
void test01()
{
typedef std::basic_regex<wchar_t> test_type;
bool test __attribute__((unused)) = true;
wchar_t s[] = L"a+b|c";
test_type re;
re.assign(s, s + 5);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <string>
#include <regex>
#include <testsuite_hooks.h>
// Tests C++ string assignment of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
std::wstring s(L"a*b");
test_type re;
re.assign(s);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.3] class template basic_regex assign()
#include <string>
#include <regex>
#include <testsuite_hooks.h>
// Tests basic_regex assignment operator from a C++ string;
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
std::wstring s(L"a*b");
test_type re;
re = s;
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.8.2 basic_regex constructors
#include <regex>
void
test01()
{
std::regex re("(a|b)*abb", std::regex::basic);
}
int main()
{
test01();
return 0;
}
// { dg-do run }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests Pascal-style counted-string constructor of the basic_regex class.
void test01()
{
const char* cs = "aab";
std::regex re(cs, 3, std::regex::basic);
VERIFY( re.flags() & std::regex_constants::basic );
}
int
main()
{
test01();
return 0;
};
// { dg-do run }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests Pascal-style counted-string constructor of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
const wchar_t* cs = L"aab";
std::wregex re(cs, 3, std::wregex::basic);
VERIFY( re.flags() & std::regex_constants::basic );
}
int
main()
{
test01();
return 0;
};
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.8.2 basic_regex ctor
// Tests for invalid range expression
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
try
{
std::regex re("a\\{1,2,3\\}", std::regex::basic);
}
catch (std::regex_error& ex)
{
VERIFY( ex.code() == std::regex_constants::error_badbrace );
}
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests C-style null-terminated-string constructor of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
const char* cs = "aab";
test_type re(cs);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.8.2 basic_regex constructors
#include <regex>
void
test01()
{
std::regex re("(a|b)*abb", std::regex::awk);
}
int main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.8.2 basic_regex constructors
#include <regex>
void
test01()
{
std::regex re("(a|b)*abb");
}
int main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.8.2 basic_regex constructors
#include <regex>
void
test01()
{
std::regex re("(a|b)*abb", std::regex::egrep);
}
int main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.8.2 basic_regex constructors
#include <regex>
void
test01()
{
using std::regex;
regex re("(a|b)*abb", regex::grep);
}
int main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests default constructor of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
// default constructor
test_type re;
// Check for required typedefs
typedef test_type::value_type value_type;
typedef test_type::flag_type flag_type;
typedef test_type::locale_type locale_type;
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests range constructor of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
char s[] = "a+b|c";
test_type re(s, s + 5);
}
int
main()
{
test01();
return 0;
};
// { dg-options "-std=c++0x" }
// 2010-07-07 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2](11) class template basic_regex constructors
#include <regex>
#include <testsuite_hooks.h>
// Tests copy constructor of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
test_type src_re("aaba");
test_type target_re(src_re);
VERIFY( target_re.flags() == src_re.flags() );
VERIFY( target_re.mark_count() == src_re.mark_count() );
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.8.2 basic_regex constructors
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("(wee|week)(knights|night)", std::regex::extended);
VERIFY( re.flags() == std::regex::extended );
VERIFY( re.mark_count() == 0 );
}
int main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.8.2 basic_regex ctor
// Tests for invalid range expression
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
try
{
std::regex re("a{1,2,3}", std::regex::extended);
}
catch (std::regex_error& ex)
{
VERIFY( ex.code() == std::regex_constants::error_badbrace );
}
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=gnu++0x" }
// 2010-07-07 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2](12-14) class template basic_regex constructors
#include <regex>
#include <testsuite_hooks.h>
#include <utility>
// Tests move constructor of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<char> test_type;
test_type src_re("aaba");
const unsigned mark_count = src_re.mark_count();
const test_type::flag_type flags = src_re.flags();
test_type target_re = std::move(src_re);
VERIFY( target_re.flags() == flags );
VERIFY( target_re.mark_count() == mark_count );
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <string>
#include <regex>
#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
// Tests C++ string constructor of the basic_regex class.
void test01()
{
typedef std::basic_regex<char> test_type;
std::string s("a*b");
test_type re(s);
}
void test02()
{
typedef std::basic_regex<char> test_type;
typedef __gnu_test::tracker_allocator<char> alloc_type;
std::basic_string<char, std::char_traits<char>, alloc_type> s("a*b");
test_type re(s);
}
int
main()
{
test01();
test02();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <string>
#include <regex>
#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
// Tests C++ string constructor of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
std::wstring s(L"a*b");
test_type re(s);
}
void test02()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
typedef __gnu_test::tracker_allocator<wchar_t> alloc_type;
std::basic_string<wchar_t, std::char_traits<wchar_t>, alloc_type> s(L"a*b");
test_type re(s);
}
int
main()
{
test01();
test02();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests C-style null-terminated-string constructor of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
const wchar_t* cs = L"aab";
test_type re(cs);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests default constructor of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
// default constructor
test_type re;
// Check for required typedefs
typedef test_type::value_type value_type;
typedef test_type::flag_type flag_type;
typedef test_type::locale_type locale_type;
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// [28.8.2] class template basic_regex constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests range constructor of the basic_regex class.
void test01()
{
bool test __attribute__((unused)) = true;
typedef std::basic_regex<wchar_t> test_type;
wchar_t s[] = L"a+b|c";
test_type re(s, s + 5);
}
int
main()
{
test01();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
// 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2007, 2009, 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 7.4 typedef std::regex
#include <regex>
void
test01()
{
std::regex re;
}
int main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-09 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.9.1 [re.submatch.members] sub_match members
#include <regex>
#include <string>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef char value_type;
typedef std::basic_string<value_type> string_type;
typedef std::sub_match<value_type*> sub_match_type;
value_type test_data[] = "cabbage";
sub_match_type sm;
sm.first = test_data + 0;
sm.second = test_data + sizeof(test_data)/sizeof(value_type);
sm.matched = true;
string_type sm_string = sm;
VERIFY( sm_string == string_type(test_data) );
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-09 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.9.1 [re.submatch.members] sub_match members
#include <regex>
#include <string>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef wchar_t value_type;
typedef std::basic_string<value_type> string_type;
typedef std::sub_match<value_type*> sub_match_type;
value_type test_data[] = L"cabbage";
sub_match_type sm;
sm.first = test_data + 0;
sm.second = test_data + sizeof(test_data)/sizeof(value_type);
sm.matched = true;
string_type sm_string = sm;
VERIFY( sm_string == string_type(test_data) );
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-09 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.9.1 [re.submatch.members] sub_match members
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::sub_match<const char*> sm_t;
const char* test_data = "cabbage";
sm_t::difference_type test_len = 3;
sm_t sm1;
sm1.first = test_data + 0;
sm1.second = test_data + test_len;
sm1.matched = true;
sm_t sm2;
sm2.matched = false;
VERIFY( sm1.length() == test_len );
VERIFY( sm2.length() == 0 );
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-07 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.9 Class template sub_match
#include <regex>
void
test01()
{
typedef std::sub_match<char*> sm;
typedef sm::value_type value_type;
typedef sm::difference_type difference_type;
typedef sm::iterator iterator;
typedef sm::string_type string_type;
}
// { dg-options "-std=c++0x" }
// 2009-06-10 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// C++0X [28.10.1] class template match_results constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests default constructor of the match_result class.
void test01()
{
bool test __attribute__((unused)) = true;
std::cmatch cm;
VERIFY( cm.size() == 0 );
VERIFY( cm.str() == std::cmatch::string_type() );
}
void test02()
{
bool test __attribute__((unused)) = true;
std::smatch sm;
VERIFY( sm.size() == 0 );
VERIFY( sm.str() == std::smatch::string_type() );
}
int
main()
{
test01();
test02();
return 0;
};
// { dg-options "-std=c++0x" }
// 2009-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com>
//
// Copyright (C) 2009 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// C++0X [28.10.1] class template match_results constructor
#include <regex>
#include <testsuite_hooks.h>
// Tests default constructor of the match_result class.
void test01()
{
bool test __attribute__((unused)) = true;
std::wcmatch cm;
VERIFY( cm.size() == 0 );
VERIFY( cm.str() == std::wcmatch::string_type() );
}
void test02()
{
bool test __attribute__((unused)) = true;
std::wsmatch sm;
VERIFY( sm.size() == 0 );
VERIFY( sm.str() == std::wsmatch::string_type() );
}
int
main()
{
test01();
test02();
return 0;
};
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.10 Class template sub_match
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::match_results<char*> mr;
typedef mr::value_type value_type;
typedef mr::const_reference const_reference;
typedef mr::reference reference;
typedef mr::const_iterator const_iterator;
typedef mr::iterator iterator;
typedef mr::difference_type difference_type;
typedef mr::size_type size_type;
typedef mr::allocator_type allocator_type;
typedef mr::char_type char_type;
typedef mr::string_type string_type;
}
// { dg-options "-std=c++0x" }
//
// 2010-06-11 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests BRE against a std::string target.
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("\\(a\\).*", std::regex::basic);
std::string target("aaba");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
VERIFY( m[1].first == target.begin() );
VERIFY( m[1].second == target.begin()+1 );
VERIFY( m[1].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests BRE against a std::string target, exercising range {0,3}
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("a\\{0,3\\}", std::regex::basic);
std::string target("aa");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests BRE against a std::string target, exercising range {1,3}
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("a\\{1,3\\}", std::regex::basic);
std::string target("aa");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests BRE against a std::string target, exercising range {2,3}
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("a\\{2,3\\}", std::regex::basic);
std::string target("aa");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-06-21 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests ERE against a C-string target, plus-sign match.
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("(a+)", std::regex::extended);
const char target[] = "aa";
std::cmatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( re.mark_count() == 1 );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target );
VERIFY( m.prefix().second == target );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target+sizeof(target) );
VERIFY( m.suffix().second == target+sizeof(target) );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target );
VERIFY( m[0].second == target+sizeof(target) );
VERIFY( m[0].matched == true );
VERIFY( m[1].first == target );
VERIFY( m[1].second == target+sizeof(target) );
VERIFY( m[1].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-06-21 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests ERE against a C-string target, question-mark match.
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("(aa?)", std::regex::extended);
char target[] = "a";
std::cmatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( re.mark_count() == 1 );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target );
VERIFY( m.prefix().second == target );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target+sizeof(target) );
VERIFY( m.suffix().second == target+sizeof(target) );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target );
VERIFY( m[0].second == target+sizeof(target) );
VERIFY( m[0].matched == true );
VERIFY( m[1].first == target );
VERIFY( m[1].second == target+sizeof(target) );
VERIFY( m[1].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
//
// 2010-06-11 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests ERE against a std::string target.
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re(".*", std::regex::extended);
std::string target("aaba");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests ERE against a std::string target, exercising range {0,3}
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("a{0,3}", std::regex::extended);
std::string target("aa");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests ERE against a std::string target, exercising range {1,3}
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("a{1,3}", std::regex::extended);
std::string target("aa");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-options "-std=c++0x" }
// { dg-do run { xfail *-*-* } }
//
// 2010-06-16 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.11.2 regex_match
// Tests ERE against a std::string target, exercising range {2,3}
#include <regex>
#include <testsuite_hooks.h>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex re("a{2,3}", std::regex::extended);
std::string target("aa");
std::smatch m;
VERIFY( std::regex_match(target, m, re) );
VERIFY( m.size() == re.mark_count()+1 );
VERIFY( m.empty() == false );
VERIFY( m.prefix().first == target.begin() );
VERIFY( m.prefix().second == target.begin() );
VERIFY( m.prefix().matched == false );
VERIFY( m.suffix().first == target.end() );
VERIFY( m.suffix().second == target.end() );
VERIFY( m.suffix().matched == false );
VERIFY( m[0].first == target.begin() );
VERIFY( m[0].second == target.end() );
VERIFY( m[0].matched == true );
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.12.1 Class template regex_iterator
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_iterator<char*> it;
std::cregex_iterator cit;
std::sregex_iterator sit;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.12.1 Class template regex_iterator
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_iterator<wchar_t*> it;
std::wcregex_iterator cit;
std::wsregex_iterator sit;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.12.1 Class template regex_iterator
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::regex_iterator<char*> it;
typedef it::regex_type regex_type;
typedef it::value_type value_type;
typedef it::difference_type difference_type;
typedef it::pointer pointer;
typedef it::reference reference;
typedef it::iterator_category iterator_category;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.12.2 Class template regex_token_iterator
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_token_iterator<char*> it;
std::cregex_token_iterator cit;
std::sregex_token_iterator sit;
}
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.12.2 Class template regex_token_iterator
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
std::regex_token_iterator<wchar_t*> it;
std::wcregex_token_iterator cit;
std::wsregex_token_iterator sit;
}
// { dg-do compile }
// { dg-options "-std=c++0x" }
//
// 2010-06-10 Stephen M. Webb <stephen.webb@bregmasoft.ca>
//
// Copyright (C) 2010 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 28.12.2 Class template regex_token_iterator
#include <regex>
void
test01()
{
bool test __attribute__((unused)) = true;
typedef std::regex_token_iterator<char*> it;
typedef it::regex_type regex_type;
typedef it::value_type value_type;
typedef it::difference_type difference_type;
typedef it::pointer pointer;
typedef it::reference reference;
typedef it::iterator_category iterator_category;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment