[cfe-commits] [libcxx] r171321 - in /libcxx/trunk: include/string test/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
Howard Hinnant
hhinnant at apple.com
Mon Dec 31 12:09:48 PST 2012
Author: hhinnant
Date: Mon Dec 31 14:09:48 2012
New Revision: 171321
URL: http://llvm.org/viewvc/llvm-project?rev=171321&view=rev
Log:
Klaas de Vries: Fix bug in libc++'s std::string::find_first_not_of.
Modified:
libcxx/trunk/include/string
libcxx/trunk/test/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
Modified: libcxx/trunk/include/string
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=171321&r1=171320&r2=171321&view=diff
==============================================================================
--- libcxx/trunk/include/string (original)
+++ libcxx/trunk/include/string Mon Dec 31 14:09:48 2012
@@ -3374,7 +3374,7 @@
{
const_pointer __p = data();
const_pointer __pe = __p + __sz;
- for (const_pointer __ps = __p + __pos; __p != __pe; ++__ps)
+ for (const_pointer __ps = __p + __pos; __ps != __pe; ++__ps)
if (!traits_type::eq(*__ps, __c))
return static_cast<size_type>(__ps - __p);
}
Modified: libcxx/trunk/test/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp?rev=171321&r1=171320&r2=171321&view=diff
==============================================================================
--- libcxx/trunk/test/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp (original)
+++ libcxx/trunk/test/strings/basic.string/string.ops/string_find.first.not.of/char_size.pass.cpp Mon Dec 31 14:09:48 2012
@@ -59,6 +59,8 @@
test(S("oselktgbcapndfjihrmq"), 'q', 21, S::npos);
test(S(""), 'q', S::npos);
+ test(S("q"), 'q', S::npos);
+ test(S("qqq"), 'q', S::npos);
test(S("csope"), 'q', 0);
test(S("gfsmthlkon"), 'q', 0);
test(S("laenfsbridchgotmkqpj"), 'q', 0);
More information about the cfe-commits
mailing list