Skip to content

Commit

Permalink
Adds ABSL_ATTRIBUTE_LIFETIME_BOUND to absl::BitGenRef
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 611151721
Change-Id: Ic7b342770fb3e1aab8e54ff125f1529534eedc3c
  • Loading branch information
derekmauro authored and copybara-github committed Feb 28, 2024
1 parent cfde5f7 commit 953cec7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions absl/random/bit_gen_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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>) {}
Expand All @@ -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>) {}
Expand Down

0 comments on commit 953cec7

Please sign in to comment.