mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-28 13:21:35 +08:00
vstring.h (operator[]): Allow s[s.size()] in debug mode, but not pedantic mode.
2006-03-28 Paolo Carlini <pcarlini@suse.de> * include/ext/vstring.h (operator[]): Allow s[s.size()] in debug mode, but not pedantic mode. From-SVN: r112447
This commit is contained in:
parent
37e47ee963
commit
df10833162
@ -1,3 +1,8 @@
|
||||
2006-03-28 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/ext/vstring.h (operator[]): Allow s[s.size()] in
|
||||
debug mode, but not pedantic mode.
|
||||
|
||||
2006-03-24 Mark Mitchell <mark@codesourcery.com>
|
||||
Joseph S. Myers <joseph@codesourcery.com>
|
||||
|
||||
|
@ -449,7 +449,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||
reference
|
||||
operator[](size_type __pos)
|
||||
{
|
||||
_GLIBCXX_DEBUG_ASSERT(__pos < this->size());
|
||||
// allow pos == size() as v3 extension:
|
||||
_GLIBCXX_DEBUG_ASSERT(__pos <= this->size());
|
||||
// but be strict in pedantic mode:
|
||||
_GLIBCXX_DEBUG_PEDASSERT(__pos < this->size());
|
||||
this->_M_leak();
|
||||
return this->_M_data()[__pos];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user