Annotate absl::AnyInvocable as an owner type via [[gsl::Owner]] and absl_internal_is_view = std::false_type
PiperOrigin-RevId: 813889090
Change-Id: Ie2a2577e32475af8edbcf4ea939fdf747d81904b
diff --git a/absl/functional/any_invocable.h b/absl/functional/any_invocable.h
index ade6cff..6dd72b6 100644
--- a/absl/functional/any_invocable.h
+++ b/absl/functional/any_invocable.h
@@ -39,6 +39,7 @@
#include <type_traits>
#include <utility>
+#include "absl/base/attributes.h"
#include "absl/base/config.h"
#include "absl/base/nullability.h"
#include "absl/functional/internal/any_invocable.h"
@@ -159,7 +160,7 @@
// AnyInvocable<void()> empty;
// empty(); // WARNING: Undefined behavior!
template <class Sig>
-class ABSL_NULLABILITY_COMPATIBLE AnyInvocable
+class ABSL_NULLABILITY_COMPATIBLE ABSL_ATTRIBUTE_OWNER AnyInvocable
: private internal_any_invocable::Impl<Sig> {
private:
static_assert(
@@ -171,6 +172,7 @@
public:
// The return type of Sig
using result_type = typename Impl::result_type;
+ using absl_internal_is_view = std::false_type;
// Constructors