[all-commits] [llvm/llvm-project] 83014d: [libc++] LWG 3857: allow `string_view` conversion ...

Joe Loser via All-commits all-commits at lists.llvm.org
Thu Feb 16 05:00:55 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83014d877017a796f89e4bb81347132619731bf9
      https://github.com/llvm/llvm-project/commit/83014d877017a796f89e4bb81347132619731bf9
  Author: Joe Loser <joeloser at fastmail.com>
  Date:   2023-02-16 (Thu, 16 Feb 2023)

  Changed paths:
    M libcxx/docs/Status/Cxx2bIssues.csv
    M libcxx/include/string_view
    M libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
    R libcxx/test/std/strings/string.view/string.view.cons/from_string1.compile.fail.cpp
    R libcxx/test/std/strings/string.view/string.view.cons/from_string2.compile.fail.cpp

  Log Message:
  -----------
  [libc++] LWG 3857: allow `string_view` conversion when only traits vary

The `basic_string_view` constructor accepting a contiguous range rejects
converting between `basic_string_view` even when only the trait types vary.
This prevents conversions for converting from `basic_string_view<C, T1>` and
`basic_string<C, T1, A>` to `basic_string_view<C, T2>`.  Recently, this
constructor was made `explicit`, so there's no reason to really forbid this
conversion anymore.

Relax the restriction that the trait types need to match in this constructor.

Differential Revision: https://reviews.llvm.org/D143972




More information about the All-commits mailing list