summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/basic_string.tcc
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-16 09:51:14 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-16 09:51:14 +0000
commitc9c456866a6cd7ae52739c35766c4f1349a01676 (patch)
tree22129bfacf61f0b81eb55300b82b6c1575083d37 /libstdc++-v3/include/bits/basic_string.tcc
parente2d5ef6897a91c796b45163f395c0bec16522a3b (diff)
downloadgcc-c9c456866a6cd7ae52739c35766c4f1349a01676.tar.gz
* include/bits/basic_string.tcc (_Rep::_S_create): Call
_M_set_sharable() for backwards compatibility. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/basic_string.tcc')
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 4cf5f29ad36..fadf9b34ea1 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -588,6 +588,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void* __place = _Raw_bytes_alloc(__alloc).allocate(__size);
_Rep *__p = new (__place) _Rep;
__p->_M_capacity = __capacity;
+ // ABI compatibility - 3.4.x set in _S_create both
+ // _M_refcount and _M_length. All callers of _S_create
+ // in basic_string.tcc then set just _M_length.
+ // In 4.0.x and later both _M_refcount and _M_length
+ // are initialized in the callers, unfortunately we can
+ // have 3.4.x compiled code with _S_create callers inlined
+ // calling 4.0.x+ _S_create.
+ __p->_M_set_sharable();
return __p;
}