Skip to content

Commit a7b249e

Browse files
committed
Reland "Add clang::lifetimebound annotation to llvm::function_ref"
This relands 9f79615, which was reverted in e109c49. The compiler-rt breakage is fixed.
1 parent 7c3bbfd commit a7b249e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/ADT/STLFunctionalExtras.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define LLVM_ADT_STLFUNCTIONALEXTRAS_H
1717

1818
#include "llvm/ADT/STLForwardCompat.h"
19+
#include "llvm/Support/Compiler.h"
1920

2021
#include <cstdint>
2122
#include <type_traits>
@@ -52,7 +53,7 @@ class function_ref<Ret(Params...)> {
5253

5354
template <typename Callable>
5455
function_ref(
55-
Callable &&callable,
56+
Callable &&callable LLVM_LIFETIME_BOUND,
5657
// This is not the copy-constructor.
5758
std::enable_if_t<!std::is_same<remove_cvref_t<Callable>,
5859
function_ref>::value> * = nullptr,

0 commit comments

Comments
 (0)