[CODE HEALTH] Fix clang-tidy misc-override-with-different-visibility warnings#4215
Merged
marcalff merged 4 commits intoJul 7, 2026
Merged
Conversation
…warnings Align the visibility of virtual overrides with their base-class declaration across 13 files, resolving 31 of the 36 warnings from open-telemetry#4195. The remaining 5 (http_server.h / socket_tools.h private-inheritance cases) are deferred to a follow-up. Lower the clang-tidy warning_limit to 280 (abiv1) and 288 (abiv2) accordingly. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4215 +/- ##
=======================================
Coverage 82.83% 82.83%
=======================================
Files 415 415
Lines 17431 17431
=======================================
Hits 14437 14437
Misses 2994 2994
🚀 New features to boost your workflow:
|
marcalff
approved these changes
Jul 6, 2026
marcalff
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the cleanup
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.
Contributes to #4195
Changes
Fixes a subset of #4195 by aligning the visibility of virtual function overrides with their base-class declaration, which is the fix the
misc-override-with-different-visibilitycheck asks for (per the check documentation).This PR resolves 31 of the 36 reported warnings across 13 files. The remaining 5 warnings (in
ext/include/opentelemetry/ext/http/server/http_server.handsocket_tools.h) arise fromprivate/protectedinheritance ofSocketTools::Reactor::SocketCallbackand need a different, more careful change; they are deferred to a follow-up PR to keep this one reviewable.Fix pattern
public-> derived override madepublic(widening; e.g. test mocks ofGetLogger/GetTracer,Predicate::Match,Fields)protected-> derived override madeprotected(e.g.sdk::logs::Logger::EnabledImplementation, gtestSetUp/TearDown)private(NVI) -> derived override madeprivate(e.g.MetricReader::OnForceFlush/OnShutDown/OnInitialized)No behavior change: only access specifiers on overrides are adjusted;
.ccdefinitions do not restate visibility.Verification
warning_limitin.github/workflows/clang-tidy.yamlis lowered accordingly (abiv1: 309 -> 280, abiv2: 319 -> 288), derived from the current CI baseline minus the 29 (abiv1) / 31 (abiv2) warnings resolved here.