Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix type_traits.h to address compiler warnings around using deprecated methods #3384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

agrawroh
Copy link

Description

__has_trivial_copy has been deprecated in favor of __is_trivially_assignable. This is causing issues while bumping up the Open Telemetry dependency in Envoy from v1.29 => v1.20 [See This].

Changes

We have created a patch in Envoy and are trying to upstream the fixes to get a clean patch-free build.

@agrawroh agrawroh requested a review from a team as a code owner April 26, 2025 18:23
Copy link

linux-foundation-easycla bot commented Apr 26, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: step-security-bot / name: StepSecurity Bot (1d8da44)

Copy link

netlify bot commented Apr 26, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit ad21e5c
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/680dd296519aba000819c966

Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.69%. Comparing base (7801cd9) to head (ad21e5c).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3384      +/-   ##
==========================================
+ Coverage   89.67%   89.69%   +0.02%     
==========================================
  Files         211      211              
  Lines        6832     6832              
==========================================
+ Hits         6126     6127       +1     
+ Misses        706      705       -1     

see 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.

@owent
Copy link
Member

owent commented Apr 27, 2025

#3355 should already fix this problem.
Could you please try it?
__is_trivially_assignable is not available in some old toolchains which are maintained by community.

@agrawroh
Copy link
Author

#3355 should already fix this problem. Could you please try it? __is_trivially_assignable is not available in some old toolchains which are maintained by community.

Thanks, @owent. Looks like the suggested patch fixes the issue so I'll close this PR.

@agrawroh agrawroh closed this Apr 27, 2025
@agrawroh agrawroh reopened this Apr 27, 2025
@agrawroh
Copy link
Author

@owent I spoke too soon. Looks like we are still seeing the same issue even with the suggested patch:

bazel-out/k8-opt/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/nostd/type_traits.h:145:73: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
  145 |   static constexpr bool value = std::is_copy_constructible<T>::value && __has_trivial_copy(T);
      |                                                                         ^
bazel-out/k8-opt/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/nostd/type_traits.h:157:70: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins]
  157 |   static constexpr bool value = std::is_copy_assignable<T>::value && __has_trivial_assign(T);
      |                                                                      ^
2 errors generated.

@owent
Copy link
Member

owent commented Apr 27, 2025

@owent I spoke too soon. Looks like we are still seeing the same issue even with the suggested patch:

bazel-out/k8-opt/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/nostd/type_traits.h:145:73: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
  145 |   static constexpr bool value = std::is_copy_constructible<T>::value && __has_trivial_copy(T);
      |                                                                         ^
bazel-out/k8-opt/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/nostd/type_traits.h:157:70: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins]
  157 |   static constexpr bool value = std::is_copy_assignable<T>::value && __has_trivial_assign(T);
      |                                                                      ^
2 errors generated.

Sorry, there were some mistakes before, could you please try the latest version of #3355 ?

@agrawroh
Copy link
Author

@owent I spoke too soon. Looks like we are still seeing the same issue even with the suggested patch:

bazel-out/k8-opt/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/nostd/type_traits.h:145:73: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins]
  145 |   static constexpr bool value = std::is_copy_constructible<T>::value && __has_trivial_copy(T);
      |                                                                         ^
bazel-out/k8-opt/bin/external/io_opentelemetry_cpp/api/_virtual_includes/api/opentelemetry/nostd/type_traits.h:157:70: error: builtin __has_trivial_assign is deprecated; use __is_trivially_assignable instead [-Werror,-Wdeprecated-builtins]
  157 |   static constexpr bool value = std::is_copy_assignable<T>::value && __has_trivial_assign(T);
      |                                                                      ^
2 errors generated.

Sorry, there were some mistakes before, could you please try the latest version of #3355 ?

Yes, that worked. I'll close this one out. Thanks!

@agrawroh agrawroh closed this Apr 27, 2025
@owent owent mentioned this pull request Apr 28, 2025
3 tasks
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.

2 participants