[CODE HEALTH] Fix clang-tidy cppcoreguidelines-special-member-functions warnings in trace API#3934
Open
dbarker wants to merge 2 commits intoopen-telemetry:mainfrom
Open
Conversation
9f55e0d to
ed586ee
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3934 +/- ##
==========================================
+ Coverage 90.06% 90.06% +0.01%
==========================================
Files 226 226
Lines 7227 7229 +2
==========================================
+ Hits 6508 6510 +2
Misses 719 719
🚀 New features to boost your workflow:
|
marcalff
reviewed
Mar 14, 2026
| DefaultSpan(const DefaultSpan &spn) noexcept : span_context_(spn.span_context_) {} | ||
|
|
||
| DefaultSpan &operator=(const DefaultSpan &spn) | ||
| { |
Member
There was a problem hiding this comment.
Not sure, should the code test assignment of a DefaultSpan to itself ?
Member
Author
There was a problem hiding this comment.
Good question. I don't think we really need a self-assignment test here. DefaultSpan assignment only assigns SpanContext, and SpanContext is made of self-safe value members.
Member
There was a problem hiding this comment.
Thanks for the investigations.
Please add a self-assignment test then, for robustness, so we don't have to think about it again.
This code is not likely to be in any critical path anyway.
marcalff
reviewed
Mar 14, 2026
Member
marcalff
left a comment
There was a problem hiding this comment.
Looks good, just one question.
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.
Fixes
cppcoreguidelines-special-member-functionswarnings inopentelemetry/traceChanges
Fixes the following warnings:
cppcoreguidelines-special-member-functions (5 warnings)
opentelemetry-cpp/api/include/opentelemetry/trace/default_span.hopentelemetry-cpp/api/include/opentelemetry/trace/span_context.hopentelemetry-cpp/api/include/opentelemetry/trace/span_context_kv_iterable.hopentelemetry-cpp/api/include/opentelemetry/trace/tracer.hopentelemetry-cpp/api/include/opentelemetry/trace/tracer_provider.hFor significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes