summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2024-02-28 10:38:44 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2024-02-28 10:40:01 -0800
commit953cec754aca513df7163abb8859c6b81dc9b202 (patch)
tree18597cdbef1504b03265941a1e3a82de28dd8067 /absl
parentcfde5f74e276049727f9556f13473a59fe77d9eb (diff)
Adds ABSL_ATTRIBUTE_LIFETIME_BOUND to absl::BitGenRef
PiperOrigin-RevId: 611151721 Change-Id: Ic7b342770fb3e1aab8e54ff125f1529534eedc3c
Diffstat (limited to 'absl')
-rw-r--r--absl/random/bit_gen_ref.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/random/bit_gen_ref.h b/absl/random/bit_gen_ref.h
index e475221a..2160a8dd 100644
--- a/absl/random/bit_gen_ref.h
+++ b/absl/random/bit_gen_ref.h
@@ -28,6 +28,7 @@
#include <type_traits>
#include <utility>
+#include "absl/base/attributes.h"
#include "absl/base/internal/fast_type_id.h"
#include "absl/base/macros.h"
#include "absl/meta/type_traits.h"
@@ -114,7 +115,7 @@ class BitGenRef {
(!std::is_same<URBG, BitGenRef>::value &&
random_internal::is_urbg<URBG>::value &&
!HasInvokeMock<URBG>::value)>* = nullptr>
- BitGenRef(URBG& gen) // NOLINT
+ BitGenRef(URBG& gen ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT
: t_erased_gen_ptr_(reinterpret_cast<uintptr_t>(&gen)),
mock_call_(NotAMock),
generate_impl_fn_(ImplFn<URBG>) {}
@@ -123,7 +124,7 @@ class BitGenRef {
typename absl::enable_if_t<(!std::is_same<URBG, BitGenRef>::value &&
random_internal::is_urbg<URBG>::value &&
HasInvokeMock<URBG>::value)>* = nullptr>
- BitGenRef(URBG& gen) // NOLINT
+ BitGenRef(URBG& gen ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT
: t_erased_gen_ptr_(reinterpret_cast<uintptr_t>(&gen)),
mock_call_(&MockCall<URBG>),
generate_impl_fn_(ImplFn<URBG>) {}