Skip to content

include/swift/Basic: fix deprecation warnings #62868

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

Merged
merged 1 commit into from
Jan 7, 2023

Conversation

MaxDesiatov
Copy link
Contributor

These are deprecation warnings

include/swift/Basic/type_traits.h:49:29: warning: builtin __has_trivial_constructor is deprecated; use __is_trivially_constructible instead [-Wdeprecated-builtins]
  static const bool value = __has_trivial_constructor(T);
                            ^
include/swift/Basic/type_traits.h:61:29: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
  static const bool value = __has_trivial_destructor(T);
                            ^
2 warnings generated.

@MaxDesiatov MaxDesiatov requested a review from jckarter January 5, 2023 16:22
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@jckarter this apparently reverts your previous commit 1a602e9 that started using these deprecated versions in the first place, would you be available for review then?

@MaxDesiatov MaxDesiatov force-pushed the maxd/has-trivial-constructor branch from 7b8dc37 to 7dfb3ea Compare January 5, 2023 16:26
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Do we need to worry about compatibility with older compilers? I think that __has_trivial_constructor is older I believe, so we are going to reduce the compatibility matrix here.

@MaxDesiatov MaxDesiatov force-pushed the maxd/has-trivial-constructor branch from 85a5bab to a19fd21 Compare January 5, 2023 16:45
@MaxDesiatov MaxDesiatov requested a review from compnerd January 5, 2023 16:45
@MaxDesiatov
Copy link
Contributor Author

MaxDesiatov commented Jan 5, 2023

Would conditionally enabling __is_trivially_constructible and __is_trivially_destructible, but falling back, when those are unavailable, on deprecated versions be ok?

These are deprecation warnings
```
include/swift/Basic/type_traits.h:49:29: warning: builtin __has_trivial_constructor is deprecated; use __is_trivially_constructible instead [-Wdeprecated-builtins]
  static const bool value = __has_trivial_constructor(T);
                            ^
include/swift/Basic/type_traits.h:61:29: warning: builtin __has_trivial_destructor is deprecated; use __is_trivially_destructible instead [-Wdeprecated-builtins]
  static const bool value = __has_trivial_destructor(T);
                            ^
2 warnings generated.
```
@MaxDesiatov MaxDesiatov force-pushed the maxd/has-trivial-constructor branch from a19fd21 to e5ab9b4 Compare January 5, 2023 16:47
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

Thanks!

@compnerd compnerd merged commit 9a7555c into main Jan 7, 2023
@compnerd compnerd deleted the maxd/has-trivial-constructor branch January 7, 2023 16:49
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