Skip to content

Commit 00aa845

Browse files
committed
[NFC] Fix change in SWIFT_CLASS_NAMED macro
#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.
1 parent eecde02 commit 00aa845

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/PrintAsClang/ClangMacros.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ CLANG_MACRO_BODY("SWIFT_CLASS", \
133133
"SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) " \
134134
"SWIFT_CLASS_EXTRA\n" \
135135
"# define SWIFT_CLASS_NAMED(SWIFT_NAME) " \
136-
"__attribute((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) " \
136+
"__attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) " \
137137
"SWIFT_CLASS_EXTRA\n" \
138138
"# else\n" \
139139
"# define SWIFT_CLASS(SWIFT_NAME) " \

0 commit comments

Comments
 (0)