chore: Enable clang-tidy bugprone-move-forwarding-reference check - #6457
Merged
bthomee merged 2 commits intoMar 4, 2026
Merged
Conversation
godexsoft
marked this pull request as ready for review
March 3, 2026 14:46
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables the clang-tidy bugprone-move-forwarding-reference check and updates a unit test to avoid triggering the new diagnostic.
Changes:
- Enable
bugprone-move-forwarding-referencein the repository’s.clang-tidyconfiguration. - Adjust a
requires-based negative compile-time test inMultiApiJson_test.cppto avoid moving a forwarding reference.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/test/protocol/MultiApiJson_test.cpp |
Updates a static_assert/requires test case that previously used std::move on a forwarding reference. |
.clang-tidy |
Enables the bugprone-move-forwarding-reference check. |
Comments suppressed due to low confidence (1)
src/test/protocol/MultiApiJson_test.cpp:560
decltype(v){}here tries to value-initializedecltype(v), but in this lambdavis deduced as an lvalue reference (MultiApiJson<...>&), sodecltype(v)is a reference type and cannot be constructed. That makes therequiresfail for the wrong reason, weakening the intent of the test ("cannot bind rvalue"). Prefer creating an rvalue of the underlying object type without construction, e.g. usingstd::declval<std::remove_reference_t<decltype(v)>>()in the requirement, or keepstd::move(v)with a targetedNOLINTsince this is intentional in an unevaluatedrequirescontext.
v.visitor(
decltype(v){}, // cannot bind rvalue
1,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6457 +/- ##
=======================================
Coverage 79.8% 79.8%
=======================================
Files 858 858
Lines 67766 67766
Branches 7554 7547 -7
=======================================
+ Hits 54078 54093 +15
+ Misses 13688 13673 -15 🚀 New features to boost your workflow:
|
bthomee
approved these changes
Mar 4, 2026
bthomee
enabled auto-merge (squash)
March 4, 2026 16:19
beartec-jpg
pushed a commit
to beartec-jpg/FalconLedger
that referenced
this pull request
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
This PR enables clang-tidy
bugprone-move-forwarding-referencecheck.Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)