Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gloop/base/censushandle_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ TEST(CensusHandleTest, Move) {
auto e = new TestEntry();
CensusHandle h1 = TestEntry::Wrap(e);
CensusHandle h2 = std::move(h1);
EXPECT_EQ(TestEntry::Get(h1), nullptr); // NOLINT: use-after-move ok
EXPECT_EQ(TestEntry::Get(h1), nullptr); // NOLINT(bugprone-use-after-move)
EXPECT_EQ(TestEntry::Get(h2), e);
h1 = std::move(h2);
EXPECT_EQ(TestEntry::Get(h1), e); // NOLINT: use-after-move ok
EXPECT_EQ(TestEntry::Get(h2), nullptr); // NOLINT: use-after-move ok
EXPECT_EQ(TestEntry::Get(h1), e); // NOLINT(bugprone-use-after-move)
EXPECT_EQ(TestEntry::Get(h2), nullptr); // NOLINT(bugprone-use-after-move)
}

void BM_CensusHandleConstructDestruct(benchmark::State& state) {
Expand Down
9 changes: 6 additions & 3 deletions gloop/base/context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ TEST_F(ContextTest, MoveConstructor) {
Context moved(std::move(copied));
EXPECT_THAT(ctx, EqualsContext(moved));
#if BASE_CONTEXT_HAVE_SECURITYCONTEXT
// NOLINTNEXTLINE - we want to test that security was modified.
// NOLINTNEXTLINE(bugprone-use-after-move) - we want to test that security was
// modified.
EXPECT_NE(copied.security(), moved.security()) << "Security was moved.";
#endif // BASE_CONTEXT_HAVE_SECURITYCONTEXT
}
Expand All @@ -310,7 +311,8 @@ TEST_F(ContextTest, MoveAssignment) {
moved = std::move(copied);
EXPECT_THAT(ctx, EqualsContext(moved));
#if BASE_CONTEXT_HAVE_SECURITYCONTEXT
// NOLINTNEXTLINE - we want to test that security was modified.
// NOLINTNEXTLINE(bugprone-use-after-move) - we want to test that security was
// modified.
EXPECT_EQ(nullptr, copied.security()) << "Security was moved.";
#endif // BASE_CONTEXT_HAVE_SECURITYCONTEXT

Expand All @@ -323,7 +325,8 @@ TEST_F(ContextTest, MoveAssignment) {
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
// NOLINTNEXTLINE - ClangTidy complains that the object was moved.
// NOLINTNEXTLINE(bugprone-use-after-move) - ClangTidy complains that the
// object was moved.
EXPECT_THAT(ctx, EqualsContext(moved));
}

Expand Down
3 changes: 2 additions & 1 deletion gloop/strings/memblock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ AlignedMemBlock::~AlignedMemBlock() {
absl::Cord CordFromMemBlock(
absl_nonnull std::unique_ptr<const MemBlock> block) {
absl::string_view block_view = block->ToStringPiece();
return absl::MakeCordFromExternal(block_view, [b = std::move(block)] {});
auto releaser = [b = std::move(block)] {};
return absl::MakeCordFromExternal(block_view, std::move(releaser));
}

void NoopReleaser(void* absl_nullable) {}
Expand Down
6 changes: 4 additions & 2 deletions gloop/thread/wait_state_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@ std::string RunOnPeriodicClosure(absl::AnyInvocable<void() &&> f) {
std::string RunOnTimedCall(absl::AnyInvocable<void() &&> f) {
// Create a new TimedCall that will delete itself when done.
auto tc = std::make_unique<TimedCall>();
tc->Set(base::ToWallTime(absl::Now()),
[f = std::move(f), tc = std::move(tc)]() mutable { std::move(f)(); });
auto* raw_tc = tc.get();
raw_tc->Set(
base::ToWallTime(absl::Now()),
[f = std::move(f), tc = std::move(tc)]() mutable { std::move(f)(); });
// This is the name of the one thread that runs all TimedCalls.
return "timedcall";
}
Expand Down
Loading