summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorswarmer <[email protected]>2025-03-11 20:17:27 +0300
committerswarmer <[email protected]>2025-03-11 20:34:27 +0300
commit1d27939449612e7fc287df4599bc3f1fc5132ea6 (patch)
treea226fc576d13be4a2b92dae264beae2bf35042ac
parent23da12b948bb8eddf000625913119101f91ab1ea (diff)
check lifetimes of TStringBuf constructed from TString without taking into account copy-on-write semantics
`TString` is a copy-on-write type, which means that in some cases the valid lifetime of its data might extend beyond the lifetime of an individual `TString` (if it was copied). However, there are practically no cases where this behaviour is appropriate, and leaving around an "owning" `TString` is undesirable. Due to this behaviour we have previously refrained from enabling `[[clang::lifetimebound]]` for `TStringBuf` constructors, because some cases of view construction from a temporary `TString` were in fact valid. This commit enables the check, as all existing related bugs in Arcadia have been fixed. Please see the related ticket and the announcement on Этушка (link will be in the post-commit comments) for more information. commit_hash:b2b6831ac3106a4e76064b85ec2d748b415ed67c
-rw-r--r--util/generic/strbuf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/generic/strbuf.h b/util/generic/strbuf.h
index 920b22123eb..d7a55b840ef 100644
--- a/util/generic/strbuf.h
+++ b/util/generic/strbuf.h
@@ -132,7 +132,7 @@ public:
}
template <typename T>
- inline TBasicStringBuf(const TBasicString<TCharType, T>& str Y_STRING_LIFETIME_BOUND) noexcept
+ inline TBasicStringBuf(const TBasicString<TCharType, T>& str Y_LIFETIME_BOUND) noexcept
: TStringView(str.data(), str.size())
{
}