[llvm] Add clang::lifetimebound annotation to llvm::function_ref (PR #115019)
Haojian Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 6 00:28:18 PST 2024
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/115019
>From 7745a25a81e013e879a30edc8257e48e19555602 Mon Sep 17 00:00:00 2001
From: Haojian Wu <hokein.wu at gmail.com>
Date: Tue, 5 Nov 2024 17:33:45 +0100
Subject: [PATCH] Add clang::lifetimebound annotation to llvm::function_ref
---
llvm/include/llvm/ADT/STLFunctionalExtras.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/llvm/include/llvm/ADT/STLFunctionalExtras.h b/llvm/include/llvm/ADT/STLFunctionalExtras.h
index 6f172504b3c167..3b9d40959d7142 100644
--- a/llvm/include/llvm/ADT/STLFunctionalExtras.h
+++ b/llvm/include/llvm/ADT/STLFunctionalExtras.h
@@ -16,6 +16,7 @@
#define LLVM_ADT_STLFUNCTIONALEXTRAS_H
#include "llvm/ADT/STLForwardCompat.h"
+#include "llvm/Support/Compiler.h"
#include <cstdint>
#include <type_traits>
@@ -52,7 +53,7 @@ class function_ref<Ret(Params...)> {
template <typename Callable>
function_ref(
- Callable &&callable,
+ Callable &&callable LLVM_LIFETIME_BOUND,
// This is not the copy-constructor.
std::enable_if_t<!std::is_same<remove_cvref_t<Callable>,
function_ref>::value> * = nullptr,
More information about the llvm-commits
mailing list