summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/ext/vstring.h
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-28 12:54:04 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-28 12:54:04 +0000
commitaaa85a7e31771f5fc55ef32e01d5909ada2e926e (patch)
treeeed3c41b2b3e939695cee8867e1bfc790c66662d /libstdc++-v3/include/ext/vstring.h
parent62838b071143b61f338a69430d2b59ebb83e7b2a (diff)
downloadppe42-gcc-aaa85a7e31771f5fc55ef32e01d5909ada2e926e.tar.gz
ppe42-gcc-aaa85a7e31771f5fc55ef32e01d5909ada2e926e.zip
2006-03-28 Paolo Carlini <pcarlini@suse.de>
* include/ext/vstring.h (operator[]): Allow s[s.size()] in debug mode, but not pedantic mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112447 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext/vstring.h')
-rw-r--r--libstdc++-v3/include/ext/vstring.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index a117c5826ee..5cd84b15a30 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -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];
}
OpenPOWER on IntegriCloud