The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/flat_hash_map_test.cc
1 issues
Line: 72
INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, UniquePtrModifiersTest,
UniquePtrMapTypes);
TEST(FlatHashMap, StandardLayout) {
struct Int {
explicit Int(size_t value) : value(value) {}
Int() : value(0) { ADD_FAILURE(); }
Int(const Int& other) : value(other.value) { ADD_FAILURE(); }
Int(Int&&) = default;
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/flat_hash_set_test.cc
1 issues
Line: 63
INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, MembersTest, SetTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, ModifiersTest, SetTypes);
TEST(FlatHashSet, EmplaceString) {
std::vector<std::string> v = {"a", "b"};
absl::flat_hash_set<absl::string_view> hs(v.begin(), v.end());
EXPECT_THAT(hs, UnorderedElementsAreArray(v));
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/inlined_vector_benchmark.cc
1 issues
Line: 248
Column: 24
CWE codes:
120
VecType vec;
size = sizeof(vec);
}
state.SetLabel(absl::StrCat("sz=", size));
}
BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector<char, 1>);
BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector<char, 4>);
BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector<char, 7>);
BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector<char, 8>);
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/inlined_vector_exception_safety_test.cc
1 issues
Line: 148
return false;
}
TYPED_TEST(NoSizeTest, DefaultConstructor) {
using VecT = typename TypeParam::VecT;
using allocator_type = typename VecT::allocator_type;
testing::TestThrowingCtor<VecT>();
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/inlined_vector_test.cc
1 issues
Line: 56
using IntVec = absl::InlinedVector<int, 8>;
MATCHER_P(SizeIs, n, "") {
return testing::ExplainMatchResult(n, arg.size(), result_listener);
}
MATCHER_P(CapacityIs, n, "") {
return testing::ExplainMatchResult(n, arg.capacity(), result_listener);
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/btree.h
1 issues
Line: 1928
Column: 18
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
const bool equal = res.HasMatch()
? res.IsEq()
: lower != end() && !compare_keys(key, lower.key());
return {lower, equal};
}
template <typename P>
template <typename K>
auto btree<P>::equal_range(const K &key) -> std::pair<iterator, iterator> {
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/btree_container.h
1 issues
Line: 190
Column: 17
CWE codes:
126
Suggestion:
This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it
friend bool operator==(const btree_container &x, const btree_container &y) {
if (x.size() != y.size()) return false;
return std::equal(x.begin(), x.end(), y.begin());
}
friend bool operator!=(const btree_container &x, const btree_container &y) {
return !(x == y);
}
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/common.h
1 issues
Line: 113
Column: 39
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
private:
absl::optional<allocator_type> alloc_ = {};
alignas(slot_type) mutable unsigned char slot_space_[sizeof(slot_type)] = {};
};
// For sets.
template <typename Policy, typename PolicyTraits, typename Alloc,
typename = void>
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/compressed_tuple_test.cc
1 issues
Line: 58
using absl::test_internal::CopyableMovableInstance;
using absl::test_internal::InstanceTracker;
TEST(CompressedTupleTest, Sizeof) {
EXPECT_EQ(sizeof(int), sizeof(CompressedTuple<int>));
EXPECT_EQ(sizeof(int), sizeof(CompressedTuple<int, Empty<0>>));
EXPECT_EQ(sizeof(int), sizeof(CompressedTuple<int, Empty<0>, Empty<1>>));
EXPECT_EQ(sizeof(int),
sizeof(CompressedTuple<int, Empty<0>, Empty<1>, Empty<2>>));
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/hash_function_defaults_test.cc
1 issues
Line: 34
using ::testing::Types;
TEST(Eq, Int32) {
hash_default_eq<int32_t> eq;
EXPECT_TRUE(eq(1, 1u));
EXPECT_TRUE(eq(1, char{1}));
EXPECT_TRUE(eq(1, true));
EXPECT_TRUE(eq(1, double{1.1}));
Reported by Cppcheck.