Skip to content

Commit b4e899a

Browse files
ckennellycopybara-github
authored andcommitted
Annotate absl::FixedArray to warn when unused.
PiperOrigin-RevId: 715803554 Change-Id: Ic0b733641174922b89f4d8c3ae2cb2762db76d5c
1 parent 41984a2 commit b4e899a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

absl/container/fixed_array.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <type_traits>
4242

4343
#include "absl/algorithm/algorithm.h"
44+
#include "absl/base/attributes.h"
4445
#include "absl/base/config.h"
4546
#include "absl/base/dynamic_annotations.h"
4647
#include "absl/base/internal/throw_delegate.h"
@@ -74,7 +75,7 @@ constexpr static auto kFixedArrayUseDefault = static_cast<size_t>(-1);
7475
// `std::vector`.
7576
template <typename T, size_t N = kFixedArrayUseDefault,
7677
typename A = std::allocator<T>>
77-
class FixedArray {
78+
class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray {
7879
static_assert(!std::is_array<T>::value || std::extent<T>::value > 0,
7980
"Arrays with unknown bounds cannot be used with FixedArray.");
8081

0 commit comments

Comments
 (0)