https://github.com/tshakalekholoane created https://github.com/llvm/llvm-project/pull/183484
Swift interop attributes such as `swift_name`, `swift_attr`, and `swift_private` previously only supported GNU-style spelling. Add the missing `[[]]` attribute spellings for C++11 and C23 compatibility, bringing them in line with other Clang attributes. >From efb7c86e12b3b5776040b7fd122ecbef0ff93e93 Mon Sep 17 00:00:00 2001 From: Tshaka Lekholoane <[email protected]> Date: Thu, 26 Feb 2026 11:45:42 +0200 Subject: [PATCH] [Clang] Add missing C++11/C23 style attributes for Swift import --- clang/include/clang/Basic/Attr.td | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index a5641e2e008cd..870423270022a 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -3149,21 +3149,21 @@ def SwiftNullability : Attr { } def SwiftAsyncName : InheritableAttr { - let Spellings = [GNU<"swift_async_name">]; + let Spellings = [Clang<"swift_async_name">]; let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[ObjCMethod, Function], ErrorDiag>; let Documentation = [SwiftAsyncNameDocs]; } def SwiftAttr : DeclOrTypeAttr { - let Spellings = [GNU<"swift_attr">]; + let Spellings = [Clang<"swift_attr">]; let Args = [StringArgument<"Attribute">]; let Documentation = [SwiftAttrDocs]; let PragmaAttributeSupport = 1; } def SwiftBridge : InheritableAttr { - let Spellings = [GNU<"swift_bridge">]; + let Spellings = [Clang<"swift_bridge">]; let Args = [StringArgument<"SwiftType">]; let Subjects = SubjectList<[Tag, TypedefName, ObjCInterface, ObjCProtocol], ErrorDiag>; @@ -3185,7 +3185,7 @@ def SwiftObjCMembers : Attr { } def SwiftError : InheritableAttr { - let Spellings = [GNU<"swift_error">]; + let Spellings = [Clang<"swift_error">]; let Args = [ EnumArgument<"Convention", "ConventionKind", /*is_string=*/false, ["none", "nonnull_error", "null_result", "zero_result", "nonzero_result"], @@ -3212,13 +3212,13 @@ def SwiftImportPropertyAsAccessors : InheritableAttr { } def SwiftName : InheritableAttr { - let Spellings = [GNU<"swift_name">]; + let Spellings = [Clang<"swift_name">]; let Args = [StringArgument<"Name">]; let Documentation = [SwiftNameDocs]; } def SwiftNewType : InheritableAttr { - let Spellings = [GNU<"swift_newtype">, GNU<"swift_wrapper">]; + let Spellings = [Clang<"swift_newtype">, Clang<"swift_wrapper">]; let Args = [EnumArgument<"NewtypeKind", "NewtypeKind", /*is_string=*/false, ["struct", "enum"], ["NK_Struct", "NK_Enum"]>]; let Subjects = SubjectList<[TypedefName], ErrorDiag>; @@ -3227,7 +3227,7 @@ def SwiftNewType : InheritableAttr { } def SwiftPrivate : InheritableAttr { - let Spellings = [GNU<"swift_private">]; + let Spellings = [Clang<"swift_private">]; let Documentation = [SwiftPrivateDocs]; let SimpleHandler = 1; } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
