Skip to content

Commit 154acf7

Browse files
committed
Attempt GCC 12 workaround
1 parent cf223eb commit 154acf7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test/test_from_chars_bases.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ std::string format_signed(int128_t value, int base)
6464
{
6565
// |INT128_MIN| does not fit in int128_t; do the magnitude in uint128_t.
6666
const uint128_t magnitude {uint128_t{1} << 127U};
67-
return std::string{"-"} + format_unsigned(magnitude, base);
67+
std::string out {format_unsigned(magnitude, base)};
68+
out.insert(out.begin(), '-');
69+
return out;
6870
}
6971

7072
if (value < int128_t{0})
7173
{
72-
return std::string{"-"} + format_unsigned(static_cast<uint128_t>(-value), base);
74+
std::string out {format_unsigned(static_cast<uint128_t>(-value), base)};
75+
out.insert(out.begin(), '-');
76+
return out;
7377
}
7478

7579
return format_unsigned(static_cast<uint128_t>(value), base);

0 commit comments

Comments
 (0)