Skip to content

[API Notes] Allow tag-based API notes on anonymous tag decls with typedef names #7871

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

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Dec 12, 2023

It is common practice in C to declare anonymous tags that are immediately given a typedef name, e.g.,

typedef enum { ... } MyType;

At present, one can only express API notes on the typedef. However, that excludes the possibility of tag-specific notes like EnumExtensibility. For these anonymous declarations, process API notes using the typedef name as the tag name, so that one can add API notes to MyType via the Tags section.

Fixes rdar://40617284 / swiftlang/swift#50323

…edef names

It is common practice in C to declare anonymous tags that are
immediately given a typedef name, e.g.,

    typedef enum { ... } MyType;

At present, one can only express API notes on the typedef. However, that
excludes the possibility of tag-specific notes like EnumExtensibility.
For these anonymous declarations, process API notes using the typedef
name as the tag name, so that one can add API notes to `MyType` via
the `Tags` section.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

#7871

@swift-ci please smoke test

@DougGregor DougGregor merged commit 769486d into swiftlang:stable/20230725 Dec 13, 2023
@DougGregor DougGregor deleted the apinotes-anon-tags-with-typedef-names branch December 13, 2023 05:19
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.

1 participant