Skip to content

LazyInit: Delete unused move assignment operator - #17107

Merged
clonker merged 1 commit into
argotorg:developfrom
kediyalua:develop
Oct 15, 2026
Merged

clonker merged 1 commit into
argotorg:developfrom
kediyalua:develop

Conversation

@kediyalua

@kediyalua kediyalua commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

util::LazyInit::operator=(LazyInit&&) previously had no return statement. Instantiating it produces a -Wreturn-type warning, which becomes a build error under -Werror. Since the operator is unused in the codebase, it is now explicitly deleted:

LazyInit& operator=(LazyInit&&) = delete;

Following the review feedback, test/libsolutil/LazyInit.cpp is unchanged from the base branch. This PR changes only libsolutil/LazyInit.h.

No Changelog.md entry: the operator was unused and could not be compiled with -Werror.

Checklist

AI Disclosure

AI assistance was used for the reviewer-requested revisions and targeted verification.

Test plan

  • Compiled the real libsolutil/LazyInit.h with only the Boost-dependent Assertions.h and Exceptions.h stubbed out, using clang++ -std=c++23 -Wall -Wextra -Werror.
  • Verified that move assignment is unavailable, move construction still works and leaves the source empty, and a direct move-assignment expression fails to compile because the operator is deleted.
  • The full test suite was not run locally because CMake and Boost test dependencies are unavailable in this environment.

Comment thread test/libsolutil/LazyInit.cpp Outdated
@blishko

blishko commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

I had another, deeper, look and it looks like the move assignment operator of LazyInit is not used anywhere in the codebase (not surprising given that it is buggy).
I currently don't see a reason to support it so I think a better fix is just to explicitly delete the move assignment operator.

@blishko blishko self-assigned this Oct 12, 2026
@clonker

clonker commented Oct 12, 2026

Copy link
Copy Markdown
Member

We can't compile code that uses it thanks to -Werror. I agree with removing it.

@kediyalua kediyalua changed the title LazyInit: Return *this from move assignment operator LazyInit: Delete unused move assignment operator Oct 14, 2026
@kediyalua

Copy link
Copy Markdown
Contributor Author

We can't compile code that uses it thanks to -Werror. I agree with removing it.

Thanks @blishko and @clonker. I agree with removing the unused operator. I’ve changed LazyInit’s move assignment to = delete, replaced the previous test with a compile-time check, and force-pushed the revision as a single commit. I’ve also updated the PR description. Please take another look when you have a chance.

Comment thread test/libsolutil/LazyInit.cpp Outdated

@clonker clonker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks :)

@clonker
clonker dismissed blishko’s stale review October 14, 2026 23:40

all is addressed!

Signed-off-by: kediyalua <kediyalua@outlook.com>
@clonker
clonker enabled auto-merge October 14, 2026 23:40
@clonker
clonker merged commit bbfadd4 into argotorg:develop Oct 15, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants