Skip to content

[libc++] std::out_of_range thrown when calling str() && on default-constructed ostringstream #64346

@pfusik

Description

@pfusik
// ./bin/clang++ -std=c++20 /tmp/test.cc -g
#include <iostream>
#include <sstream>

int main() {
  std::ostringstream oss;
  std::cerr << std::move(oss).str();
  return 0;
}

fails with libc++abi: terminating due to uncaught exception of type std::out_of_range: basic_string

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions