[libcxx-commits] [PATCH] D145257: [libc++] Fixes basic_string operator& hijacking.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 3 10:54:06 PST 2023


Mordante created this revision.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Avoids using operator& in basic_string since an evil char-like type can
hijack this operator. Added some more evil operators, this found a place
where equality was compared directly and not via the traits.

This adds a helper test string. This is now only used in a few tests,
but the intention is to use this in more tests for basic_string.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145257

Files:
  libcxx/include/string
  libcxx/test/std/strings/basic.string/string.modifiers/string_append/initializer_list.pass.cpp
  libcxx/test/std/strings/basic.string/string.modifiers/string_assign/string.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145257.502185.patch
Type: text/x-patch
Size: 8478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230303/8b0c462b/attachment.bin>


More information about the libcxx-commits mailing list