Skip to content

[5.10][Macros] Disallow expression macro as default argument #69704

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
Nov 8, 2023

Conversation

ApolloZhu
Copy link
Contributor

Cherry-pick of #68782


  • Explanation: add error diagnostics to disallow non-built-in expression macros used as default arguments for function declarations. It's important to add this diagnostic early before developers start to rely on the undefined behavior of how macros work in this case
  • Scope: function declarations that use non-built-in expression macro as default argument
  • Main Branch PR: [Macros] Disallow expression macro as default argument #68782
  • Resolves: rdar://115674594
  • Risk: Low, as the impacted scope should not be allowed, as specified in SE-0382
  • Reviewed By: @DougGregor
  • Testing: added test-cases to the test suite

…ault-argument

[Macros] Disallow expression macro as default argument
@ApolloZhu ApolloZhu requested a review from a team as a code owner November 7, 2023 20:51
@ApolloZhu
Copy link
Contributor Author

@swift-ci please test

@ApolloZhu ApolloZhu added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.10 labels Nov 7, 2023
@DougGregor DougGregor merged commit 69bd272 into release/5.10 Nov 8, 2023
@DougGregor DougGregor deleted the ApolloZhu/cherry-pick/5.10/68782 branch November 8, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants