Sponsored Content
Skip to content

chore: Enable clang-tidy check for CRTP constructor accessibility - #6452

Merged
bthomee merged 12 commits into
XRPLF:developfrom
godexsoft:chore/clang-tidy-checks-crtp-accessibility
Mar 16, 2026
Merged

chore: Enable clang-tidy check for CRTP constructor accessibility#6452
bthomee merged 12 commits into
XRPLF:developfrom
godexsoft:chore/clang-tidy-checks-crtp-accessibility

Conversation

@godexsoft

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR enables bugprone-crtp-constructor-accessibility and fixes the few compilation issues we got from enabling it.

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@godexsoft godexsoft added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 2, 2026
@codecov

codecov Bot commented Mar 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.8%. Comparing base (1a4c359) to head (fb00b3c).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6452   +/-   ##
=======================================
  Coverage     79.8%   79.8%           
=======================================
  Files          878     878           
  Lines        67887   67895    +8     
  Branches      7554    7551    -3     
=======================================
+ Hits         54196   54212   +16     
+ Misses       13691   13683    -8     
Files with missing lines Coverage Δ
src/libxrpl/basics/ResolverAsio.cpp 91.1% <ø> (ø)
src/xrpld/app/paths/detail/BookStep.cpp 95.5% <100.0%> (+<0.1%) ⬆️
src/xrpld/app/paths/detail/DirectStep.cpp 83.9% <100.0%> (+0.2%) ⬆️
src/xrpld/app/paths/detail/XRPEndpointStep.cpp 83.3% <100.0%> (+0.3%) ⬆️

... and 4 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@godexsoft
godexsoft marked this pull request as ready for review March 3, 2026 11:59
Copilot AI review requested due to automatic review settings March 3, 2026 11:59
@godexsoft godexsoft removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables the bugprone-crtp-constructor-accessibility clang-tidy check and updates several CRTP-style classes to satisfy the new rule by tightening base-constructor accessibility.

Changes:

  • Enable bugprone-crtp-constructor-accessibility in .clang-tidy.
  • Make CRTP base constructors non-public and add friend TDerived/friend Derived where needed.
  • Replace inherited constructors (using Base::Base) with explicit derived constructors in affected step types.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/xrpld/app/paths/detail/XRPEndpointStep.cpp Makes CRTP base ctor non-public and adds friendship; adds explicit ctor for XRPEndpointPaymentStep.
src/xrpld/app/paths/detail/DirectStep.cpp Makes CRTP base ctor private + friends derived; replaces inherited ctors with explicit ctors in derived classes.
src/xrpld/app/paths/detail/BookStep.cpp Makes CRTP base ctor private + friends derived; adds explicit ctor for BookPaymentStep.
src/test/app/XChain_test.cpp Updates CRTP-like test helper to have a non-public base ctor and friends the derived type.
src/libxrpl/basics/ResolverAsio.cpp Makes AsyncObject ctor non-public and friends Derived for CRTP compliance.
.clang-tidy Enables the new bugprone check and reorders a few existing checks in the list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bthomee
bthomee requested a review from a1q123456 March 4, 2026 21:38
Comment thread src/xrpld/app/paths/detail/XRPEndpointStep.cpp
@godexsoft
godexsoft requested a review from a1q123456 March 11, 2026 17:33

@a1q123456 a1q123456 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@godexsoft
godexsoft requested a review from bthomee March 16, 2026 12:46
@godexsoft godexsoft added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Mar 16, 2026
@bthomee
bthomee enabled auto-merge (squash) March 16, 2026 19:53
@bthomee
bthomee merged commit f5e2415 into XRPLF:develop Mar 16, 2026
1 check passed
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
…PLF#6452)

This change enables the `bugprone-crtp-constructor-accessibility` check and fixes the few compilation issues resulting from enabling it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants