summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2024-06-12 08:13:58 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2024-06-12 08:14:45 -0700
commit567ebd0540f4e56d125491e71e2727d8ab5458e0 (patch)
treeee113945348f45a35b4f236abacf769227632c4d
parenta0889af0a23030e6bb27c6c7241bade7e59cb763 (diff)
Add ABSL_INTERNAL_ATTRIBUTE_VIEW and ABSL_INTERNAL_ATTRIBUTE_OWNER attributes to types in Abseil
PiperOrigin-RevId: 642619703 Change-Id: I8d2e423a3c7f40709d0e8c82cac0395c75d601cf
-rw-r--r--absl/container/btree_set.h1
-rw-r--r--absl/container/flat_hash_map.h8
-rw-r--r--absl/container/flat_hash_set.h3
-rw-r--r--absl/container/node_hash_map.h3
-rw-r--r--absl/container/node_hash_set.h3
-rw-r--r--absl/strings/string_view.h2
-rw-r--r--absl/types/span.h2
7 files changed, 14 insertions, 8 deletions
diff --git a/absl/container/btree_set.h b/absl/container/btree_set.h
index 51dc42b7..97b203a9 100644
--- a/absl/container/btree_set.h
+++ b/absl/container/btree_set.h
@@ -52,6 +52,7 @@
#ifndef ABSL_CONTAINER_BTREE_SET_H_
#define ABSL_CONTAINER_BTREE_SET_H_
+#include "absl/base/attributes.h"
#include "absl/container/internal/btree.h" // IWYU pragma: export
#include "absl/container/internal/btree_container.h" // IWYU pragma: export
diff --git a/absl/container/flat_hash_map.h b/absl/container/flat_hash_map.h
index aa2c5c8c..1c43e92d 100644
--- a/absl/container/flat_hash_map.h
+++ b/absl/container/flat_hash_map.h
@@ -36,6 +36,7 @@
#include <utility>
#include "absl/algorithm/container.h"
+#include "absl/base/attributes.h"
#include "absl/base/macros.h"
#include "absl/container/hash_container_defaults.h"
#include "absl/container/internal/container_memory.h"
@@ -121,9 +122,10 @@ struct FlatHashMapPolicy;
template <class K, class V, class Hash = DefaultHashContainerHash<K>,
class Eq = DefaultHashContainerEq<K>,
class Allocator = std::allocator<std::pair<const K, V>>>
-class flat_hash_map : public absl::container_internal::raw_hash_map<
- absl::container_internal::FlatHashMapPolicy<K, V>,
- Hash, Eq, Allocator> {
+class ABSL_INTERNAL_ATTRIBUTE_OWNER flat_hash_map
+ : public absl::container_internal::raw_hash_map<
+ absl::container_internal::FlatHashMapPolicy<K, V>, Hash, Eq,
+ Allocator> {
using Base = typename flat_hash_map::raw_hash_map;
public:
diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h
index e558b071..7b9e0060 100644
--- a/absl/container/flat_hash_set.h
+++ b/absl/container/flat_hash_set.h
@@ -35,6 +35,7 @@
#include <utility>
#include "absl/algorithm/container.h"
+#include "absl/base/attributes.h"
#include "absl/base/macros.h"
#include "absl/container/hash_container_defaults.h"
#include "absl/container/internal/container_memory.h"
@@ -117,7 +118,7 @@ struct FlatHashSetPolicy;
template <class T, class Hash = DefaultHashContainerHash<T>,
class Eq = DefaultHashContainerEq<T>,
class Allocator = std::allocator<T>>
-class flat_hash_set
+class ABSL_INTERNAL_ATTRIBUTE_OWNER flat_hash_set
: public absl::container_internal::raw_hash_set<
absl::container_internal::FlatHashSetPolicy<T>, Hash, Eq, Allocator> {
using Base = typename flat_hash_set::raw_hash_set;
diff --git a/absl/container/node_hash_map.h b/absl/container/node_hash_map.h
index 31beb1da..4bba130d 100644
--- a/absl/container/node_hash_map.h
+++ b/absl/container/node_hash_map.h
@@ -42,6 +42,7 @@
#include <utility>
#include "absl/algorithm/container.h"
+#include "absl/base/attributes.h"
#include "absl/container/hash_container_defaults.h"
#include "absl/container/internal/container_memory.h"
#include "absl/container/internal/node_slot_policy.h"
@@ -116,7 +117,7 @@ class NodeHashMapPolicy;
template <class Key, class Value, class Hash = DefaultHashContainerHash<Key>,
class Eq = DefaultHashContainerEq<Key>,
class Alloc = std::allocator<std::pair<const Key, Value>>>
-class node_hash_map
+class ABSL_INTERNAL_ATTRIBUTE_OWNER node_hash_map
: public absl::container_internal::raw_hash_map<
absl::container_internal::NodeHashMapPolicy<Key, Value>, Hash, Eq,
Alloc> {
diff --git a/absl/container/node_hash_set.h b/absl/container/node_hash_set.h
index deeb49ce..82e4923e 100644
--- a/absl/container/node_hash_set.h
+++ b/absl/container/node_hash_set.h
@@ -40,6 +40,7 @@
#include <type_traits>
#include "absl/algorithm/container.h"
+#include "absl/base/attributes.h"
#include "absl/container/hash_container_defaults.h"
#include "absl/container/internal/container_memory.h"
#include "absl/container/internal/node_slot_policy.h"
@@ -111,7 +112,7 @@ struct NodeHashSetPolicy;
// }
template <class T, class Hash = DefaultHashContainerHash<T>,
class Eq = DefaultHashContainerEq<T>, class Alloc = std::allocator<T>>
-class node_hash_set
+class ABSL_INTERNAL_ATTRIBUTE_OWNER node_hash_set
: public absl::container_internal::raw_hash_set<
absl::container_internal::NodeHashSetPolicy<T>, Hash, Eq, Alloc> {
using Base = typename node_hash_set::raw_hash_set;
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h
index b1fb7a10..ff760014 100644
--- a/absl/strings/string_view.h
+++ b/absl/strings/string_view.h
@@ -159,7 +159,7 @@ ABSL_NAMESPACE_BEGIN
//
// absl::string_view() == absl::string_view("", 0)
// absl::string_view(nullptr, 0) == absl::string_view("abcdef"+6, 0)
-class string_view {
+class ABSL_INTERNAL_ATTRIBUTE_VIEW string_view {
public:
using traits_type = std::char_traits<char>;
using value_type = char;
diff --git a/absl/types/span.h b/absl/types/span.h
index 560e569b..a0f80272 100644
--- a/absl/types/span.h
+++ b/absl/types/span.h
@@ -151,7 +151,7 @@ ABSL_NAMESPACE_BEGIN
// int* my_array = new int[10];
// MyRoutine(absl::Span<const int>(my_array, 10));
template <typename T>
-class Span {
+class ABSL_INTERNAL_ATTRIBUTE_VIEW Span {
private:
// Used to determine whether a Span can be constructed from a container of
// type C.