This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/28765


Hi,

tested x86-linux, committed mainline and 4_1-branch.

Paolo.

/////////////////
2006-08-18  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/28765
	* include/ext/rc_string_base.h (_M_clear): New.
	* include/ext/sso_string_base.h (_M_clear): Likewise.
	* include/ext/vstring.h (clear): Use it.
Index: include/ext/vstring.h
===================================================================
--- include/ext/vstring.h	(revision 116239)
+++ include/ext/vstring.h	(working copy)
@@ -409,7 +409,7 @@
        */
       void
       clear()
-      { this->_M_erase(size_type(0), this->size()); }
+      { this->_M_clear(); }
 
       /**
        *  Returns true if the %string is empty.  Equivalent to *this == "".
Index: include/ext/rc_string_base.h
===================================================================
--- include/ext/rc_string_base.h	(revision 116239)
+++ include/ext/rc_string_base.h	(working copy)
@@ -338,6 +338,10 @@
       void
       _M_erase(size_type __pos, size_type __n);
 
+      void
+      _M_clear()
+      { _M_erase(size_type(0), _M_length()); }
+
       bool
       _M_compare(const __rc_string_base&) const
       { return false; }
Index: include/ext/sso_string_base.h
===================================================================
--- include/ext/sso_string_base.h	(revision 116239)
+++ include/ext/sso_string_base.h	(working copy)
@@ -226,6 +226,10 @@
       void
       _M_erase(size_type __pos, size_type __n);
 
+      void
+      _M_clear()
+      { _M_set_length(0); }
+
       bool
       _M_compare(const __sso_string_base&) const
       { return false; }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]