+2010-05-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/basic_string.h (front, back): Add.
+ * include/debug/string: Adjust.
+ * include/ext/vstring.h (front, back): Tweak the implementation
+ to follow more closely the letter of the specs.
+ * testsuite/21_strings/basic_string/element_access/char/
+ front_back.cc: New.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/
+ front_back.cc: Likewise.
+ * config/abi/pre/gnu.ver: Export new symbols.
+ * testsuite/util/testsuite_abi.cc: Adjust.
+ * configure.ac: Bump minor version to 6:15:0.
+ * configure: Regenerate.
+
2010-05-28 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_vector.h (vector<>::data): Fix return type
# where it is used for size_type on LLP64 platforms.
_ZNSsC[12][EI][PRjmvyN]*;
_ZNSsD*;
- _ZNSs[0-58-9][a-z]*;
+ _ZNSs[0-58-9]a*;
+ _ZNSs5beginEv;
+ _ZNSs[0-58-9][c-e]*;
+ _ZNSs[0-58-9][g-z]*;
# _ZNSs[67][a-z]*E[PRcjmvy]*;
_ZNSs6appendE[PRcjmvy]*;
_ZNSs6assignE[PRcjmvy]*;
_ZNSsaSE[PRc]*;
_ZNSsixE*;
_ZNSspLE[PRc]*;
- _ZNKSs[0-9][a-b]*;
- _ZNKSs[0-9][d-z]*;
+ _ZNKSs[0-3][a-b]*;
+ _ZNKSs[5-9][a-b]*;
+ _ZNKSs[0-9][d-e]*;
+ _ZNKSs[0-9][g-z]*;
_ZNKSs[0-9][0-9][a-z]*;
+ _ZNKSs4find*;
_ZNKSs[a-z]*;
_ZNKSs4_Rep12_M_is_leakedEv;
_ZNKSs4_Rep12_M_is_sharedEv;
# std::wstring
_ZNSbIwSt11char_traitsIwESaIwEEC[12][EI][PRjmvyN]*;
_ZNSbIwSt11char_traitsIwESaIwEED*;
- _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][a-z]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9]a*;
+ _ZNSbIwSt11char_traitsIwESaIwEE5beginEv;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][c-e]*;
+ _ZNSbIwSt11char_traitsIwESaIwEE[0-58-9][g-z]*;
# _ZNSbIwSt11char_traitsIwESaIwEE[67][a-b]*E[PRwjmvy]*;
_ZNSbIwSt11char_traitsIwESaIwEE6appendE[PRwjmvy]*;
_ZNSbIwSt11char_traitsIwESaIwEE6assignE[PRwjmvy]*;
_ZNSbIwSt11char_traitsIwESaIwEEaSE[PRw]*;
_ZNSbIwSt11char_traitsIwESaIwEEixE*;
_ZNSbIwSt11char_traitsIwESaIwEEpLE[PRw]*;
- _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][a-b]*;
- _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][d-z]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE[0-3][a-b]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE[5-9][a-b]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][d-e]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE[0-9][g-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[0-9][0-9][a-z]*;
_ZNKSbIwSt11char_traitsIwESaIwEE[a-z]*;
+ _ZNKSbIwSt11char_traitsIwESaIwEE4find*;
_ZNKSbIwSt11char_traitsIwESaIwEE4_Rep12_M_is_leakedEv;
_ZNKSbIwSt11char_traitsIwESaIwEE4_Rep12_M_is_sharedEv;
_ZNKSbIwSt11char_traitsIwESaIwEE6_M_repEv;
} GLIBCXX_3.4.13;
+GLIBCXX_3.4.15 {
+
+ # string|wstring front and back member functions
+ _ZNSs5frontEv;
+ _ZNKSs5frontEv;
+ _ZNSbIwSt11char_traitsIwESaIwEE5frontEv;
+ _ZNKSbIwSt11char_traitsIwESaIwEE5frontEv;
+ _ZNSs4backEv;
+ _ZNKSs4backEv;
+ _ZNSbIwSt11char_traitsIwESaIwEE4backEv;
+ _ZNKSbIwSt11char_traitsIwESaIwEE4backEv;
+
+} GLIBCXX_3.4.14;
# Symbols in the support library (libsupc++) have their own tag.
CXXABI_1.3 {
### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:14:0
+libtool_VERSION=6:15:0
# Find the rest of the source tree framework.
### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
# For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:14:0
+libtool_VERSION=6:15:0
AC_SUBST(libtool_VERSION)
# Find the rest of the source tree framework.
return _M_data()[__n];
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %string.
+ */
+ reference
+ front()
+ { return operator[](0); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %string.
+ */
+ const_reference
+ front() const
+ { return operator[](0); }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %string.
+ */
+ reference
+ back()
+ { return operator[](this->size() - 1); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the
+ * last element of the %string.
+ */
+ const_reference
+ back() const
+ { return operator[](this->size() - 1); }
+#endif
+
/**
* @brief Provides access to the data contained in the %string.
* @param n The index of the character to access.
using _Base::at;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ using _Base::front;
+ using _Base::back;
+#endif
+
// 21.3.5 modifiers:
basic_string&
operator+=(const basic_string& __str)
typedef _Alloc allocator_type;
typedef typename _CharT_alloc_type::size_type size_type;
typedef typename _CharT_alloc_type::difference_type difference_type;
- typedef typename _CharT_alloc_type::reference reference;
- typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
typedef typename _CharT_alloc_type::pointer pointer;
typedef typename _CharT_alloc_type::const_pointer const_pointer;
typedef __gnu_cxx::__normal_iterator<pointer, __versa_string> iterator;
*/
reference
front()
- { return *begin(); }
+ { return operator[](0); }
/**
* Returns a read-only (constant) reference to the data at the first
*/
const_reference
front() const
- { return *begin(); }
+ { return operator[](0); }
/**
* Returns a read/write reference to the data at the last
*/
reference
back()
- { return *(end() - 1); }
+ { return operator[](this->size() - 1); }
/**
* Returns a read-only (constant) reference to the data at the
*/
const_reference
back() const
- { return *(end() - 1); }
+ { return operator[](this->size() - 1); }
#endif
// Modifiers:
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+// { dg-require-string-conversions "" }
+
+// 2010-05-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation
+//
+// 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 <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::string str("ramifications");
+ const std::string cstr("melodien");
+
+ VERIFY( str.front() == 'r' );
+ VERIFY( str.back() == 's' );
+ VERIFY( cstr.front() == 'm' );
+ VERIFY( cstr.back() == 'n' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+// { dg-require-string-conversions "" }
+
+// 2010-05-31 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation
+//
+// 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 <string>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::wstring str(L"ramifications");
+ const std::wstring cstr(L"melodien");
+
+ VERIFY( str.front() == L'r' );
+ VERIFY( str.back() == L's' );
+ VERIFY( cstr.front() == L'm' );
+ VERIFY( cstr.back() == L'n' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
// -*- C++ -*-
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Free Software Foundation, Inc.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
known_versions.push_back("GLIBCXX_3.4.12");
known_versions.push_back("GLIBCXX_3.4.13");
known_versions.push_back("GLIBCXX_3.4.14");
+ known_versions.push_back("GLIBCXX_3.4.15");
known_versions.push_back("GLIBCXX_LDBL_3.4");
known_versions.push_back("GLIBCXX_LDBL_3.4.7");
known_versions.push_back("GLIBCXX_LDBL_3.4.10");