[libcxx-commits] [libcxx] mark std::make_format_args with clang::lifetimebound attribute (PR #78997)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 22 08:03:22 PST 2024
https://github.com/kelbon updated https://github.com/llvm/llvm-project/pull/78997
>From 1638b0d3d8c16473b1d51d69b4b01756f2e7d760 Mon Sep 17 00:00:00 2001
From: Kelbon Nik <kelbonage at gmail.com>
Date: Mon, 22 Jan 2024 19:46:13 +0400
Subject: [PATCH 1/2] add lifetime bound on make_format_args
---
libcxx/include/__format/format_functions.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/include/__format/format_functions.h b/libcxx/include/__format/format_functions.h
index 015bff70f51d977..0de1c5dc7c5e326 100644
--- a/libcxx/include/__format/format_functions.h
+++ b/libcxx/include/__format/format_functions.h
@@ -63,7 +63,7 @@ using wformat_args = basic_format_args<wformat_context>;
# endif
template <class _Context = format_context, class... _Args>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&... __args) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&... __args [[clang::lifetimebound]]) {
return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
}
>From 91d484f7b1701e0003aa68c7bc019c5be10ece1f Mon Sep 17 00:00:00 2001
From: Kelbon Nik <kelbonage at gmail.com>
Date: Mon, 22 Jan 2024 20:03:08 +0400
Subject: [PATCH 2/2] format
---
libcxx/include/__format/format_functions.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcxx/include/__format/format_functions.h b/libcxx/include/__format/format_functions.h
index 0de1c5dc7c5e326..8e5396b053967ca 100644
--- a/libcxx/include/__format/format_functions.h
+++ b/libcxx/include/__format/format_functions.h
@@ -63,7 +63,8 @@ using wformat_args = basic_format_args<wformat_context>;
# endif
template <class _Context = format_context, class... _Args>
-_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...> make_format_args(_Args&... __args [[clang::lifetimebound]]) {
+_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI __format_arg_store<_Context, _Args...>
+make_format_args(_Args&... __args [[clang::lifetimebound]]) {
return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
}
More information about the libcxx-commits
mailing list