Makefile.am (sources): Add regex.cc.
authorBenjamin Kosnik <bkoz@redhat.com>
Fri, 11 Feb 2011 01:23:10 +0000 (01:23 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 11 Feb 2011 01:23:10 +0000 (01:23 +0000)
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

69 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/regex_error.h
libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in
libstdc++-v3/src/regex.cc [new file with mode: 0644]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/basic/string_01.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/basic/string_01.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/basic/string_range_00_03.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/basic/string_range_00_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/basic/string_range_01_03.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/basic/string_range_01_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/basic/string_range_02_03.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/basic/string_range_02_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/extended/cstring_plus.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/extended/cstring_plus.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/extended/cstring_questionmark.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/extended/cstring_questionmark.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/extended/string_any.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/extended/string_any.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/extended/string_range_00_03.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/extended/string_range_00_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/extended/string_range_01_03.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/extended/string_range_01_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/algorithms/02_match/extended/string_range_02_03.cc [moved from libstdc++-v3/testsuite/28_regex/11_algorithms/02_match/extended/string_range_02_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/cstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring_op.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/cstring_op.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/moveable.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/moveable.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/pstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/pstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/range.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/range.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/string.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/string_op.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/char/string_op.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/cstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/wchar_t/cstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/cstring_op.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/wchar_t/cstring_op.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/pstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/wchar_t/pstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/range.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/wchar_t/range.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/string.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/wchar_t/string.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/assign/wchar_t/string_op.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/assign/wchar_t/string_op.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/cstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/basic/cstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/pstring_char.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/basic/pstring_char.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/pstring_wchar_t.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/basic/pstring_wchar_t.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/string_range_01_02_03.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/basic/string_range_01_02_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/cstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/cstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/cstring_awk.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/cstring_awk.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/cstring_ecma.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/cstring_ecma.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/cstring_egrep.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/cstring_egrep.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/cstring_grep.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/cstring_grep.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/default.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/char/range.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/char/range.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/copy_char.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/copy_char.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/extended/cstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/extended/cstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/extended/string_range_01_02_03.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/extended/string_range_01_02_03.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/move_char.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/move_char.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/string_char.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/string_char.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/string_wchar_t.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/wchar_t/cstring.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/wchar_t/cstring.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/wchar_t/default.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/wchar_t/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/ctors/wchar_t/range.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/ctors/wchar_t/range.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/regex.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/regex.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/basic_regex/requirements/constexpr_data.cc [moved from libstdc++-v3/testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/constants/error_type.cc [moved from libstdc++-v3/testsuite/28_regex/05_constants/error_type.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/constants/match_flag_type.cc [moved from libstdc++-v3/testsuite/28_regex/05_constants/match_flag_type.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/constants/syntax_option_type.cc [moved from libstdc++-v3/testsuite/28_regex/05_constants/syntax_option_type.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/headers/04_header/regex/std_c++0x_neg.cc [moved from libstdc++-v3/testsuite/28_regex/04_header/regex/std_c++0x_neg.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/ctors/char/default.cc [moved from libstdc++-v3/testsuite/28_regex/12_iterators/regex_iterator/ctors/char/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/ctors/wchar_t/default.cc [moved from libstdc++-v3/testsuite/28_regex/12_iterators/regex_iterator/ctors/wchar_t/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/iterators/regex_iterator/typedefs.cc [moved from libstdc++-v3/testsuite/28_regex/12_iterators/regex_iterator/typedefs.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/iterators/regex_token_iterator/ctors/char/default.cc [moved from libstdc++-v3/testsuite/28_regex/12_iterators/regex_token_iterator/ctors/char/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/iterators/regex_token_iterator/ctors/wchar_t/default.cc [moved from libstdc++-v3/testsuite/28_regex/12_iterators/regex_token_iterator/ctors/wchar_t/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/iterators/regex_token_iterator/typedefs.cc [moved from libstdc++-v3/testsuite/28_regex/12_iterators/regex_token_iterator/typedefs.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/match_results/ctors/char/default.cc [moved from libstdc++-v3/testsuite/28_regex/10_match_results/ctors/char/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/match_results/ctors/wchar_t/default.cc [moved from libstdc++-v3/testsuite/28_regex/10_match_results/ctors/wchar_t/default.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/match_results/typedefs.cc [moved from libstdc++-v3/testsuite/28_regex/10_match_results/typedefs.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/regex_error/regex_error.cc [moved from libstdc++-v3/testsuite/28_regex/06_exception_type/regex_error.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/requirements/typedefs.cc [moved from libstdc++-v3/testsuite/28_regex/03_requirements/typedefs.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/sub_match/cast_char.cc [moved from libstdc++-v3/testsuite/28_regex/09_sub_match/cast_char.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/sub_match/cast_wchar_t.cc [moved from libstdc++-v3/testsuite/28_regex/09_sub_match/cast_wchar_t.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/sub_match/length.cc [moved from libstdc++-v3/testsuite/28_regex/09_sub_match/length.cc with 100% similarity]
libstdc++-v3/testsuite/28_regex/sub_match/typedefs.cc [moved from libstdc++-v3/testsuite/28_regex/09_sub_match/typedefs.cc with 100% similarity]

index 961877e..6f8dd42 100644 (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
index cfcf479..c37a0fa 100644 (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;
   };
 
 
index d6618f0..5524a77 100644 (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
index 4d8eb33..956cbb9 100644 (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
diff --git a/libstdc++-v3/src/regex.cc b/libstdc++-v3/src/regex.cc
new file mode 100644 (file)
index 0000000..8a47da3
--- /dev/null
@@ -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