debug mode, but not pedantic mode.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99967
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-05-19 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * include/bits/basic_string.h (operator[]): Allow s[s.size()] in
+ debug mode, but not pedantic mode.
+
2005-05-19 Jan Beulich <jbeulich@novell.com>
* libsupc++/unwind-cxx.h: Include cstdlib.
reference
operator[](size_type __pos)
{
- _GLIBCXX_DEBUG_ASSERT(__pos < size());
+ // allow pos == size() as v3 extension:
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ // but be strict in pedantic mode:
+ _GLIBCXX_DEBUG_PEDASSERT(__pos < size());
_M_leak();
return _M_data()[__pos];
}