File tree 2 files changed +9
-2
lines changed 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ namespace llvm {
70
70
/* implicit*/ ArrayRef (std::nullopt_t ) {}
71
71
72
72
// / Construct an ArrayRef from a single element.
73
- /* implicit*/ ArrayRef (const T &OneElt)
73
+ /* implicit*/ ArrayRef (const T &OneElt LLVM_LIFETIME_BOUND )
74
74
: Data (&OneElt), Length (1 ) {}
75
75
76
76
// / Construct an ArrayRef from a pointer and length.
@@ -103,7 +103,8 @@ namespace llvm {
103
103
104
104
// / Construct an ArrayRef from a C array.
105
105
template <size_t N>
106
- /* implicit*/ constexpr ArrayRef (const T (&Arr)[N]) : Data (Arr), Length (N) {}
106
+ /* implicit*/ constexpr ArrayRef (const T (&Arr LLVM_LIFETIME_BOUND)[N])
107
+ : Data (Arr), Length (N) {}
107
108
108
109
// / Construct an ArrayRef from a std::initializer_list.
109
110
#if LLVM_GNUC_PREREQ(9, 0, 0)
Original file line number Diff line number Diff line change 413
413
#define LLVM_GSL_POINTER
414
414
#endif
415
415
416
+ #if LLVM_HAS_CPP_ATTRIBUTE(clang::lifetimebound)
417
+ #define LLVM_LIFETIME_BOUND [[clang::lifetimebound]]
418
+ #else
419
+ #define LLVM_LLVM_LIFETIME_BOUND
420
+ #endif
421
+
416
422
#if LLVM_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L
417
423
#define LLVM_CTOR_NODISCARD [[nodiscard]]
418
424
#else
You can’t perform that action at this time.
0 commit comments