Skip to content

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

Draft
dbarker wants to merge 2 commits intoopen-telemetry:mainfrom
dbarker:fix_nostd_clang_tidy_warnings
Draft

[CODE HEALTH] Fix clang-tidy warnings in nostd files#3924
dbarker wants to merge 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 (739862d) to head (f391350).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3924      +/-   ##
==========================================
- Coverage   90.06%   90.05%   -0.01%     
==========================================
  Files         226      226              
  Lines        7223     7221       -2     
==========================================
- Hits         6505     6502       -3     
- 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 96.78% <100.00%> (-0.10%) ⬇️
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants