Skip to content

[libcxx]: string::__insert_with_size misses std::move before calling __insert_from_safe_copy #116502

@hewillk

Description

@hewillk

return __insert_from_safe_copy(__n, __ip, __first, __last);

testcase:

#include <sstream>
#include <string>
#include <ranges>
 
int main() {
  auto is = std::istringstream{"a b c d"};
  auto chars = std::views::istream<int>(is);
  std::string s;
  s.insert_range(s.begin(), std::views::counted(chars.begin(), 3));
}

https://godbolt.org/z/Eh4EP8avE

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions