This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] std::string::operator[] extension in debug mode


As discussed this makes debug mode support the v3 extension allowing
s[s.size()] on non-const strings.  This fixes these FAILs when the tests
are run in debug mode:
FAIL: 21_strings/basic_string/element_access/char/empty.cc execution test
FAIL: 21_strings/basic_string/element_access/wchar_t/empty.cc execution test

I decided to order the assertions this way so that in non-pedantic mode
pos > size() will produce an error message that shows the extension
would work.

2005-05-19  Jonathan Wakely  <...>

	* include/bits/basic_string.h (operator[]): Allow s[s.size()] in
        debug mode, but not pedantic mode.

OK for mainline and 4.0 ?

jon

Attachment: libstdcxx-string_debug_mode.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]