[libcxx-commits] [PATCH] D95251: Remove noexcept from basic_string::find and implementation functions.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 22 11:12:57 PST 2021


zoecarver created this revision.
zoecarver added reviewers: mclow.lists, ldionne.
zoecarver requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This patch removes noexcept from all fiver basic_string::find overloads
and all overloads of __search_substring and __str_find.

The standard requires that the following overloads have a noexcept
attribute, but as I demonstrate in the tests, this might have an
undesirable effect for char_traits that throw. Does it make sense for
me to file an LWG issue about this? Here are the two overloads that are
suppose to have noexcept:

  size_type find(value_type __c, size_type __pos = 0)
  size_type find(const basic_string& __str, size_type __pos = 0) const

Once this patch is approved I'll apply similar updates to rfind, find_first_of, etc.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95251

Files:
  libcxx/include/__string
  libcxx/include/string
  libcxx/test/std/strings/basic.string/string.ops/string_find/char_size.pass.cpp
  libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size.pass.cpp
  libcxx/test/std/strings/basic.string/string.ops/string_find/pointer_size_size.pass.cpp
  libcxx/test/std/strings/basic.string/string.ops/string_find/string_size.pass.cpp
  libcxx/test/std/strings/basic.string/string.ops/string_find/string_view_size.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95251.318586.patch
Type: text/x-patch
Size: 9545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210122/da6da09a/attachment.bin>


More information about the libcxx-commits mailing list