diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-12-03 14:20:56 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-12-03 14:20:56 +0000 |
commit | bcaf576b83e0c2332c2f78acb5ec7d060fdbab46 (patch) | |
tree | 9d3617a39d3b1d4730536b70b1be7b55faa58744 /libstdc++-v3/include/ext/rc_string_base.h | |
parent | ddf6c18784cd437dd96ed606aec21ff60ae604b1 (diff) | |
download | gcc-bcaf576b83e0c2332c2f78acb5ec7d060fdbab46.zip gcc-bcaf576b83e0c2332c2f78acb5ec7d060fdbab46.tar.gz gcc-bcaf576b83e0c2332c2f78acb5ec7d060fdbab46.tar.bz2 |
re PR libstdc++/42261 (infinite recursion from string(string::size_type(6), string::size_type('f')))
2009-12-03 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/42261
* include/bits/basic_string.h (_S_construct_aux(_Integer, _Integer,
const _Alloc&, __true_type)): Cast the second argument to value_type.
* include/ext/sso_string_base.h (_M_construct_aux(_Integer, _Integer,
std::__true_type)): Likewise.
* include/ext/rc_string_base.h (_S_construct_aux(_Integer, _Integer,
const _Alloc&, std::__true_type)): Likewise.
* testsuite/21_strings/basic_string/cons/char/42261.cc: New.
* testsuite/21_strings/basic_string/cons/wchar_t/42261.cc: Likewise.
From-SVN: r154948
Diffstat (limited to 'libstdc++-v3/include/ext/rc_string_base.h')
-rw-r--r-- | libstdc++-v3/include/ext/rc_string_base.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h index 6d8c430..c9fdb25 100644 --- a/libstdc++-v3/include/ext/rc_string_base.h +++ b/libstdc++-v3/include/ext/rc_string_base.h @@ -231,7 +231,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) static _CharT* _S_construct_aux(_Integer __beg, _Integer __end, const _Alloc& __a, std::__true_type) - { return _S_construct(static_cast<size_type>(__beg), __end, __a); } + { return _S_construct(static_cast<size_type>(__beg), + static_cast<value_type>(__end), __a); } template<typename _InIterator> static _CharT* |