Makefile.am (sources): Add regex.cc.

2011-02-10  Benjamin Kosnik  <bkoz@redhat.com>

	* src/Makefile.am (sources): Add regex.cc.
	* src/Makefile.in: Regenerate.
	* src/regex.cc: New.
	* include/bits/regex_error.h (error_type): Use constexpr.
	(regex_error): Move ctor and dtor out of line.

	* testsuite/28_regex/03_requirements: To...
	* testsuite/28_regex/requirements: ... this.
	* testsuite/28_regex/04_header: To...
	* testsuite/28_regex/headers: ... this.
	* testsuite/28_regex/05_constants: To...
	* testsuite/28_regex/constants: ... this.
	* testsuite/28_regex/06_exception_type: To...
	* testsuite/28_regex/regex_error: ... this.
	* testsuite/28_regex/07_traits: To...
	* testsuite/28_regex/traits: ... this.
	* testsuite/28_regex/08_basic_regex: To...
	* testsuite/28_regex/basic_regex: ... this.
	* testsuite/28_regex/09_sub_match: To...
	* testsuite/28_regex/sub_match: ... this.
	* testsuite/28_regex/10_match_results: To...
	* testsuite/28_regex/match_results: ... this.
	* testsuite/28_regex/11_algorithms: To...
	* testsuite/28_regex/algorithms: ... this.
	* testsuite/28_regex/12_iterators: To...
	* testsuite/28_regex/iterators: ... this.

From-SVN: r170038
This commit is contained in:
Benjamin Kosnik 2011-02-11 01:23:10 +00:00 committed by Benjamin Kosnik
parent b3a2810309
commit cedf52d247
69 changed files with 103 additions and 26 deletions

View File

@ -1,3 +1,32 @@
2011-02-10 Benjamin Kosnik <bkoz@redhat.com>
* src/Makefile.am (sources): Add regex.cc.
* src/Makefile.in: Regenerate.
* src/regex.cc: New.
* include/bits/regex_error.h (error_type): Use constexpr.
(regex_error): Move ctor and dtor out of line.
* testsuite/28_regex/03_requirements: To...
* testsuite/28_regex/requirements: ... this.
* testsuite/28_regex/04_header: To...
* testsuite/28_regex/headers: ... this.
* testsuite/28_regex/05_constants: To...
* testsuite/28_regex/constants: ... this.
* testsuite/28_regex/06_exception_type: To...
* testsuite/28_regex/regex_error: ... this.
* testsuite/28_regex/07_traits: To...
* testsuite/28_regex/traits: ... this.
* testsuite/28_regex/08_basic_regex: To...
* testsuite/28_regex/basic_regex: ... this.
* testsuite/28_regex/09_sub_match: To...
* testsuite/28_regex/sub_match: ... this.
* testsuite/28_regex/10_match_results: To...
* testsuite/28_regex/match_results: ... this.
* testsuite/28_regex/11_algorithms: To...
* testsuite/28_regex/algorithms: ... this.
* testsuite/28_regex/12_iterators: To...
* testsuite/28_regex/iterators: ... this.
2011-02-10 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/47662

View File

@ -60,60 +60,60 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
/** The expression contained an invalid collating element name. */
static const error_type error_collate(_S_error_collate);
static constexpr error_type error_collate(_S_error_collate);
/** The expression contained an invalid character class name. */
static const error_type error_ctype(_S_error_ctype);
static constexpr 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);
static constexpr error_type error_escape(_S_error_escape);
/** The expression contained an invalid back reference. */
static const error_type error_backref(_S_error_backref);
static constexpr error_type error_backref(_S_error_backref);
/** The expression contained mismatched [ and ]. */
static const error_type error_brack(_S_error_brack);
static constexpr error_type error_brack(_S_error_brack);
/** The expression contained mismatched ( and ). */
static const error_type error_paren(_S_error_paren);
static constexpr error_type error_paren(_S_error_paren);
/** The expression contained mismatched { and } */
static const error_type error_brace(_S_error_brace);
static constexpr 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);
static constexpr 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);
static constexpr 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);
static constexpr 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);
static constexpr 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);
static constexpr 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);
static constexpr error_type error_stack(_S_error_stack);
//@}
_GLIBCXX_END_NAMESPACE_VERSION
@ -128,9 +128,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*
* The regular expression library throws objects of this class on error.
*/
class regex_error
: public std::runtime_error
class regex_error : public std::runtime_error
{
regex_constants::error_type _M_code;
public:
/**
* @brief Constructs a regex_error object.
@ -138,9 +139,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @param ecode the regex error code.
*/
explicit
regex_error(regex_constants::error_type __ecode)
: std::runtime_error("regex_error"), _M_code(__ecode)
{ }
regex_error(regex_constants::error_type __ecode);
virtual ~regex_error() throw();
/**
* @brief Gets the regex error code.
@ -150,9 +151,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
regex_constants::error_type
code() const
{ return _M_code; }
protected:
regex_constants::error_type _M_code;
};

View File

@ -210,6 +210,7 @@ sources = \
misc-inst.cc \
ostream-inst.cc \
placeholders.cc \
regex.cc \
sstream-inst.cc \
streambuf-inst.cc \
streambuf.cc \
@ -352,6 +353,11 @@ future.lo: future.cc
future.o: future.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
regex.lo: regex.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
regex.o: regex.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
debug.lo: debug.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
debug.o: debug.cc

View File

@ -110,11 +110,11 @@ am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
strstream.lo system_error.lo tree.lo allocator-inst.lo \
concept-inst.lo fstream-inst.lo ext-inst.lo ios-inst.lo \
iostream-inst.lo istream-inst.lo istream.lo locale-inst.lo \
misc-inst.lo ostream-inst.lo placeholders.lo sstream-inst.lo \
streambuf-inst.lo streambuf.lo string-inst.lo valarray-inst.lo \
wlocale-inst.lo wstring-inst.lo mutex.lo condition_variable.lo \
chrono.lo thread.lo future.lo $(am__objects_1) \
$(am__objects_4)
misc-inst.lo ostream-inst.lo placeholders.lo regex.lo \
sstream-inst.lo streambuf-inst.lo streambuf.lo string-inst.lo \
valarray-inst.lo wlocale-inst.lo wstring-inst.lo mutex.lo \
condition_variable.lo chrono.lo thread.lo future.lo \
$(am__objects_1) $(am__objects_4)
am_libstdc___la_OBJECTS = $(am__objects_5)
libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@ -427,6 +427,7 @@ sources = \
misc-inst.cc \
ostream-inst.cc \
placeholders.cc \
regex.cc \
sstream-inst.cc \
streambuf-inst.cc \
streambuf.cc \
@ -941,6 +942,11 @@ future.lo: future.cc
future.o: future.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
regex.lo: regex.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
regex.o: regex.cc
$(CXXCOMPILE) -std=gnu++0x -c $<
debug.lo: debug.cc
$(LTCXXCOMPILE) -std=gnu++0x -c $<
debug.o: debug.cc

38
libstdc++-v3/src/regex.cc Normal file
View File

@ -0,0 +1,38 @@
// regex -*- C++ -*-
// Copyright (C) 2011 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/>.
#include <regex>
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
regex_error::regex_error(regex_constants::error_type __ecode)
: std::runtime_error("regex_error"), _M_code(__ecode)
{ }
regex_error::~regex_error() throw() { }
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std