This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/42261] infinite recursion from string(string::size_type(6), string::size_type('f'))
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Dec 2009 17:07:49 -0000
- Subject: [Bug libstdc++/42261] infinite recursion from string(string::size_type(6), string::size_type('f'))
- References: <bug-42261-2228@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from paolo dot carlini at oracle dot com 2009-12-10 17:07 -------
Grunt. Now I found the time to look in detail into the famous "do the right
thing" clause, and in fact casting only the first argument was on purpose, see
the last WP, 23.2.3/14. C++03 was different, with both casts, but we decided to
implement these new bits and it doesn't make sense at all to go back and forth
in this string constructor. I'm going to revert the patch and close as invalid.
14 For every sequence container defined in this Clause and in Clause 21:
? If the constructor
template <class InputIterator>
X(InputIterator first, InputIterator last,
const allocator_type& alloc = allocator_type())
is called with a type InputIterator that does not qualify as an input iterator,
then the constructor will behave as if the overloaded constructor:
X(size_type, const value_type& = value_type(),
const allocator_type& = allocator_type())
were called instead, with the arguments static_cast<size_type>(first), last and
alloc, respectively.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42261