From 3988d1795135a31523dbbd0605ceecae16f2b718 Mon Sep 17 00:00:00 2001
From: Doug Gregor <dgregor@apple.com>
Date: Tue, 22 Jul 2003 17:57:50 +0000
Subject: [PATCH] basic_string.h (basic_string::insert): Deprecate GNU
 extension.

* include/bits/basic_string.h (basic_string::insert): Deprecate
  GNU extension.

From-SVN: r69677
---
 libstdc++-v3/ChangeLog                   |  7 ++++++-
 libstdc++-v3/include/bits/basic_string.h | 21 ++++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 715057817aa1..a0c6a8ad19fc 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-22  Doug Gregor  <dgregor@apple.com>
+
+	* include/bits/basic_string.h (basic_string::insert): Deprecate
+	GNU extension.
+
 2003-07-21  Benjamin Kosnik  <bkoz@redhat.com>
 
 	* scripts/testsuite_flags.in (--build-includes): Remove extraneous
@@ -8,7 +13,7 @@
 	* testsuite/27_io/basic_ostream/sentry/char/3983-fstream.cc: Same.
 	* testsuite/27_io/basic_istream/sentry/char/3983-sstream.cc: Same.
 
-2003-07-21  Doug Gregor  <dgregor@apple.com.>
+2003-07-21  Doug Gregor  <dgregor@apple.com>
 
 	* include/bits/boost_concept_check.h:
 	(_EqualityComparableConcept::__constraints): Remove != from the 
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 1a534a15b650..44df752ae562 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -981,7 +981,7 @@ namespace std
        *  The value of the string doesn't change if an error is thrown.
       */
       iterator
-      insert(iterator __p, _CharT __c = _CharT())
+      insert(iterator __p, _CharT __c)
       {
 	const size_type __pos = __p - _M_ibegin();
 	this->insert(_M_check(__pos), size_type(1), __c);
@@ -989,6 +989,25 @@ namespace std
  	return this->_M_ibegin() + __pos;
       }
 
+#ifdef _GLIBCXX_DEPRECATED
+      /**
+       *  @brief  Insert one default-constructed character.
+       *  @param p  Iterator referencing position in string to insert at.
+       *  @return  Iterator referencing newly inserted char.
+       *  @throw  std::length_error  If new length exceeds @c max_size().
+       *  @throw  std::out_of_range  If @a p is beyond the end of this string.
+       *
+       *  Inserts a default-constructed character at position
+       *  referenced by @a p.  If adding character causes the length
+       *  to exceed max_size(), length_error is thrown.  If @a p is
+       *  beyond end of string, out_of_range is thrown.  The value of
+       *  the string doesn't change if an error is thrown.
+      */
+      iterator
+      insert(iterator __p)
+      { return this->insert(__p, _CharT()); }
+#endif /* _GLIBCXX_DEPRECATED */
+
       /**
        *  @brief  Remove characters.
        *  @param pos  Index of first character to remove (default 0).
-- 
GitLab