This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/13084] class string with find(const char* cstr, size_type idx) member have different gcc 2.95 and gcc 3.3 behaviour
- From: "paolo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Nov 2003 09:58:59 -0000
- Subject: [Bug libstdc++/13084] class string with find(const char* cstr, size_type idx) member have different gcc 2.95 and gcc 3.3 behaviour
- References: <20031117101347.13084.ronald.van.uden@rabobank.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From paolo at gcc dot gnu dot org 2003-11-18 09:58 -------
On second tought, the true reason why 9 is not ok whereas 0 *is* ok is that,
according to the standard (21.3.6.1, p1): "determines the _lowest_ possible
xpos, if possible, such as both the following conditions..." (emphasis mine).
Now, "the following conditions" are fulfilled both by 0 and 9, and 0 is the
correct final answer. This is also consistent with the behavior for the general
str.find(lit, pos = 0), returning pos for lit == "" (when pos <= str.size(),
otherwise npos, of course).
I'm closing the report as not a bug.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13084