Skip to content

[NFC] Fix change in SWIFT_CLASS_NAMED macro#63338

Merged
beccadax merged 1 commit intoswiftlang:mainfrom
beccadax:from-a-macro-perspective
Feb 2, 2023
Merged

[NFC] Fix change in SWIFT_CLASS_NAMED macro#63338
beccadax merged 1 commit intoswiftlang:mainfrom
beccadax:from-a-macro-perspective

Conversation

@beccadax
Copy link
Contributor

@beccadax beccadax commented Feb 1, 2023

#59072 accidentally changed the SWIFT_CLASS_NAMED macro to use __attribute when it previously used __attribute__ (note the trailing underscores). While both keywords have the same semantics in clang, they are technically different tokens, so clang refuses to merge macro definitions that use one instead of the other; instead it would diagnose an ambiguity when a generated header from a new compiler imported a generated header from an old compiler. Change back to the old token to avoid this problem.

Fixes rdar://104252758.

swiftlang#59072 accidentally changed the SWIFT_CLASS_NAMED macro to use `__attribute` when it previously used `__attribute__` (note the trailing underscores). While both keywords have the same semantics in clang, they are technically different tokens, so clang refuses to merge macro definitions that use one instead of the other; instead it would diagnose an ambiguity when a generated header from a new compiler imported a generated header from an old compiler. Change back to the old token to avoid this problem.

Fixes rdar://104252758.
@beccadax
Copy link
Contributor Author

beccadax commented Feb 1, 2023

@swift-ci please smoke test

Copy link
Contributor

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

Whoops, nice catch!

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