Skip to content

[Basic] hasFeature should succeed for promoted language features #70706

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 6, 2024

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Jan 4, 2024

Merge $<Feature> and hasFeature implementations.

  • $<Feature> did not support upcoming language features.
  • hasFeature did not support promoted language features and also didn't take into account Options in Features.def.

Remove Options entirely, it was always one of three cases:

  • true
  • langOpts.hasFeature
  • hasSwiftSwiftParser

Since LangOptions::hasFeature should always be used anyway, it's no longer necessary. hasSwiftSwiftParser can be special cased when adding the default promoted language features (by removing those features).

Resolves rdar://117917456.

@bnbarham
Copy link
Contributor Author

bnbarham commented Jan 4, 2024

@swift-ci please test

@bnbarham
Copy link
Contributor Author

bnbarham commented Jan 4, 2024

swiftlang/llvm-project#7935

@swift-ci please test

Merge `$<Feature>` and `hasFeature` implementations.
  - `$<Feature>` did not support upcoming language features.
  - `hasFeature` did not support promoted language features and also
    didn't take into account `Options` in `Features.def`.

Remove `Options` entirely, it was always one of three cases:
  - `true`
  - `langOpts.hasFeature`
  - `hasSwiftSwiftParser`

Since `LangOptions::hasFeature` should always be used anyway, it's no
longer necessary. `hasSwiftSwiftParser` can be special cased when adding
the default promoted language features (by removing those features).

Resolves rdar://117917456.
@bnbarham bnbarham force-pushed the should-have-feature branch from 5fdd1f2 to d51c58a Compare January 5, 2024 18:26
@bnbarham
Copy link
Contributor Author

bnbarham commented Jan 5, 2024

swiftlang/llvm-project#7935

@swift-ci please test

@bnbarham bnbarham merged commit dd9fe56 into swiftlang:main Jan 6, 2024
@bnbarham bnbarham deleted the should-have-feature branch January 6, 2024 00:04
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