Skip to content

[CODE HEALTH] Fix clang-tidy warnings in nostd files#3924

Merged
marcalff merged 2 commits intoopen-telemetry:mainfrom
dbarker:fix_nostd_clang_tidy_warnings
Mar 13, 2026
Merged

[CODE HEALTH] Fix clang-tidy warnings in nostd files#3924
marcalff merged 2 commits intoopen-telemetry:mainfrom
dbarker:fix_nostd_clang_tidy_warnings

Conversation

@dbarker
Copy link
Member

@dbarker dbarker commented Mar 11, 2026

Fixes or nolint 17 clang-tidy warnings in nostd

Changes

  • fix or nolint the following clang-tidy warnings in nostd files

opentelemetry-cpp/api/include/opentelemetry/nostd/function_ref.h (4 warnings)

Line Check Message
28 cppcoreguidelines-special-member-functions class 'function_ref' defines a copy constructor and a move constructor but does not define a destructor, a copy assignment operator or a move assignment operator
40 performance-unnecessary-value-param the parameter 'args' is copied for each invocation but only used as a const reference; consider making it a const reference
79 cppcoreguidelines-missing-std-forward forwarding reference parameter 'f' is never forwarded inside the function body
89 performance-unnecessary-value-param the parameter 'args' is copied for each invocation but only used as a const reference; consider making it a const reference

opentelemetry-cpp/api/include/opentelemetry/nostd/shared_ptr.h (5 warnings)

Line Check Message
43 cppcoreguidelines-special-member-functions class 'shared_ptr_wrapper' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator
99 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body
106 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body
112 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body
160 bugprone-use-after-move 'other' used after it was moved

opentelemetry-cpp/api/include/opentelemetry/nostd/span.h (2 warnings)

Line Check Message
86 cppcoreguidelines-special-member-functions class 'span' defines a copy constructor and a copy assignment operator but does not define a destructor, a move constructor or a move assignment operator
191 cppcoreguidelines-special-member-functions class 'span' defines a copy constructor and a copy assignment operator but does not define a destructor, a move constructor or a move assignment operator

opentelemetry-cpp/api/include/opentelemetry/nostd/unique_ptr.h (5 warnings)

Line Check Message
45 cppcoreguidelines-special-member-functions class 'unique_ptr' defines a non-default destructor, a move constructor and a move assignment operator but does not define a copy constructor or a copy assignment operator
61 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body
66 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body
85 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body
93 cppcoreguidelines-rvalue-reference-param-not-moved rvalue reference parameter 'other' is never moved from inside the function body

opentelemetry-cpp/api/include/opentelemetry/nostd/variant.h (1 warnings)

Line Check Message
54 abseil-no-namespace namespace 'absl' is reserved for implementation of the Abseil library and should not be opened in user code

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@dbarker dbarker changed the title [CODE HEALTH] fix clang tidy warnings in nostd files [CODE HEALTH] Fix clang-tidy warnings in nostd files Mar 11, 2026
@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.05%. Comparing base (1b3733f) to head (e9dd5b6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3924      +/-   ##
==========================================
- Coverage   90.06%   90.05%   -0.00%     
==========================================
  Files         226      226              
  Lines        7223     7226       +3     
==========================================
+ Hits         6505     6507       +2     
- Misses        718      719       +1     
Files with missing lines Coverage Δ
api/include/opentelemetry/nostd/function_ref.h 77.78% <100.00%> (ø)
api/include/opentelemetry/nostd/shared_ptr.h 97.02% <100.00%> (+0.14%) ⬆️
api/include/opentelemetry/nostd/span.h 95.92% <ø> (ø)
api/include/opentelemetry/nostd/unique_ptr.h 100.00% <100.00%> (ø)
api/include/opentelemetry/nostd/variant.h 66.67% <ø> (ø)

... and 1 file with indirect coverage changes

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

@dbarker dbarker marked this pull request as ready for review March 12, 2026 01:06
@dbarker dbarker requested a review from a team as a code owner March 12, 2026 01:06
@marcalff marcalff added the pr:do-not-merge This PR is not ready to be merged. label Mar 12, 2026
@dbarker dbarker force-pushed the fix_nostd_clang_tidy_warnings branch from 36e625f to e9dd5b6 Compare March 13, 2026 03:03
@dbarker dbarker added pr:please-review This PR is ready for review and removed pr:do-not-merge This PR is not ready to be merged. labels Mar 13, 2026
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM

@marcalff marcalff merged commit af66d8d into open-telemetry:main Mar 13, 2026
68 checks passed
@dbarker dbarker deleted the fix_nostd_clang_tidy_warnings branch March 13, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please-review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants