diff options
Diffstat (limited to 'absl/status/status.cc')
-rw-r--r-- | absl/status/status.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/absl/status/status.cc b/absl/status/status.cc index bcf3413e..6b316ac6 100644 --- a/absl/status/status.cc +++ b/absl/status/status.cc @@ -185,8 +185,11 @@ void Status::ForEachPayload( } const std::string* Status::EmptyString() { - static std::string* empty_string = new std::string(); - return empty_string; + static union EmptyString { + std::string str; + ~EmptyString() {} + } empty = {{}}; + return &empty.str; } constexpr const char Status::kMovedFromString[]; |