From 2f5aa47ad440494d3eeee0b51c601c43547c3e55 Mon Sep 17 00:00:00 2001 From: magiblot Date: Wed, 24 Jan 2024 20:12:03 +0100 Subject: [PATCH] test: fix compilation on GCC 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 7 complains that: error: ‘class std::basic_ostream’ has no member named ‘str’; did you mean ‘setf’? --- test/test.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test.cc b/test/test.cc index c0a147a..b1ae5ac 100644 --- a/test/test.cc +++ b/test/test.cc @@ -10,9 +10,11 @@ TextState TextState::decode(std::string_view input) { size_t caret = input.find(chCaret); if (caret == std::string_view::npos) - throw std::runtime_error((std::ostringstream() - << "Input text does not have a caret: '" << input << "'" - ).str()); + { + std::ostringstream os; + os << "Input text does not have a caret: '" << input << "'"; + throw std::runtime_error(os.str()); + } size_t anchor = input.find(chAnchor); if (anchor == std::string_view::npos) anchor = caret;