From 0296d7d37007ec54441cb9f8cd001da6ac58eea8 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 4 Jan 2023 12:49:23 -0800 Subject: [PATCH] Workaround for GCC12 bug illustrated by https://godbolt.org/z/Pe5aE59xG Fixes #4108 PiperOrigin-RevId: 499556061 Change-Id: I1cb1564f9b77e1825fddc9236965f4a3b661d96a --- googletest/src/gtest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index 0803cf32..08eaefbd 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -4888,7 +4888,8 @@ std::string StreamingListener::UrlEncode(const char* str) { case '=': case '&': case '\n': - result.append("%" + String::FormatByte(static_cast(ch))); + result.push_back('%'); + result.append(String::FormatByte(static_cast(ch))); break; default: result.push_back(ch);