Skip to content

Commit 105ac4b

Browse files
authored
Merge pull request #84876 from egorzhdan/egorzhdan/quotes
[cxx-interop] Quote identifiers more consistently in Clang diagnostics
2 parents d652100 + de4354b commit 105ac4b

5 files changed

+15
-15
lines changed

include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ NOTE(forward_declared_protocol_label, none,
351351

352352
NOTE(forward_declared_interface_clashes_with_imported_objc_Swift_interface, none,
353353
"interface %0 is incomplete and cannot be imported as a stub; "
354-
"its name conflicts with a %1 in module %2",
354+
"its name conflicts with a %1 in module '%2'",
355355
(const clang::NamedDecl*, StringRef, StringRef))
356356
NOTE(forward_declared_protocol_clashes_with_imported_objc_Swift_protocol, none,
357357
"protocol %0 is incomplete and cannot be imported as a stub; "
358-
"its name conflicts with a %1 in module %2",
358+
"its name conflicts with a %1 in module '%2'",
359359
(const clang::NamedDecl*, StringRef, StringRef))
360360

361361
GROUPED_WARNING(return_escapable_with_lifetimebound, ClangDeclarationImport, none,

test/ClangImporter/incomplete_objc_types_compatibility_complete_incomplete_inter_file_swift_definition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Main {
3131
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete
3232
// CHECK-NEXT: Foo *returnAFoo();
3333
// CHECK-NEXT: ^
34-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
34+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
3535
// CHECK-NEXT: @class Foo;
3636
// CHECK-NEXT: ^
3737
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' forward declared here

test/ClangImporter/incomplete_objc_types_swift_definition_imported.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ takeAFoo(foo)
2626
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete
2727
// CHECK-NEXT: void takeAFoo(Foo *foo);
2828
// CHECK-NEXT: ^
29-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
29+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
3030
// CHECK-NEXT: @class Foo;
3131
// CHECK-NEXT: ^
3232
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' forward declared here
@@ -46,7 +46,7 @@ _ = returnAFoo()
4646
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete
4747
// CHECK-NEXT: Foo *returnAFoo();
4848
// CHECK-NEXT: ^
49-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
49+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
5050
// CHECK-NEXT: @class Foo;
5151
// CHECK-NEXT: ^
5252
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' forward declared here
@@ -66,7 +66,7 @@ takeABaz(bar)
6666
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' is incomplete
6767
// CHECK-NEXT: void takeABaz(Baz *baz);
6868
// CHECK-NEXT: ^
69-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
69+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
7070
// CHECK-NEXT: @class Baz;
7171
// CHECK-NEXT: ^
7272
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' forward declared here
@@ -86,7 +86,7 @@ _ = returnABaz()
8686
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' is incomplete
8787
// CHECK-NEXT: Baz *returnABaz();
8888
// CHECK-NEXT: ^
89-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
89+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
9090
// CHECK-NEXT: @class Baz;
9191
// CHECK-NEXT: ^
9292
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Baz' forward declared here
@@ -106,7 +106,7 @@ takeASubscript(corge)
106106
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' is incomplete
107107
// CHECK-NEXT: void takeASubscript(subscript *param);
108108
// CHECK-NEXT: ^
109-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
109+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
110110
// CHECK-NEXT: @class subscript;
111111
// CHECK-NEXT: ^
112112
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' forward declared here
@@ -126,7 +126,7 @@ _ = returnASubscript()
126126
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' is incomplete
127127
// CHECK-NEXT: subscript* returnASubscript();
128128
// CHECK-NEXT: ^
129-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
129+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
130130
// CHECK-NEXT: @class subscript;
131131
// CHECK-NEXT: ^
132132
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'subscript' forward declared here
@@ -146,7 +146,7 @@ _ = returnAProtocolFoo()
146146
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolFoo' is incomplete
147147
// CHECK-NEXT: id<ProtocolFoo> returnAProtocolFoo();
148148
// CHECK-NEXT: ^
149-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolFoo' is incomplete and cannot be imported as a stub; its name conflicts with a protocol in module CompleteSwiftTypes
149+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolFoo' is incomplete and cannot be imported as a stub; its name conflicts with a protocol in module 'CompleteSwiftTypes'
150150
// CHECK-NEXT: @protocol ProtocolFoo;
151151
// CHECK-NEXT: ^
152152
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolFoo' forward declared here
@@ -166,7 +166,7 @@ _ = returnAProtocolBaz()
166166
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolBaz' is incomplete
167167
// CHECK-NEXT: id<ProtocolBaz> returnAProtocolBaz();
168168
// CHECK-NEXT: ^
169-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolBaz' is incomplete and cannot be imported as a stub; its name conflicts with a protocol in module CompleteSwiftTypes
169+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolBaz' is incomplete and cannot be imported as a stub; its name conflicts with a protocol in module 'CompleteSwiftTypes'
170170
// CHECK-NEXT: @protocol ProtocolBaz;
171171
// CHECK-NEXT: ^
172172
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolBaz' forward declared here

test/ClangImporter/incomplete_objc_types_swift_definition_imported_implementationOnly.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _ = returnAFoo()
2222
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete
2323
// CHECK-NEXT: Foo *returnAFoo();
2424
// CHECK-NEXT: ^
25-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
25+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
2626
// CHECK-NEXT: @class Foo;
2727
// CHECK-NEXT: ^
2828
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'Foo' forward declared here

test/ClangImporter/incomplete_objc_types_swift_definition_imported_name_conflict.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ takeAConflictingTypeName(qux)
2424
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' is incomplete
2525
// CHECK-NEXT: void takeAConflictingTypeName(ConflictingTypeName *param);
2626
// CHECK-NEXT: ^
27-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
27+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
2828
// CHECK-NEXT: @class ConflictingTypeName;
2929
// CHECK-NEXT: ^
3030
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' forward declared here
@@ -44,7 +44,7 @@ _ = returnAConflictingTypeName()
4444
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' is incomplete
4545
// CHECK-NEXT: ConflictingTypeName *returnAConflictingTypeName();
4646
// CHECK-NEXT: ^
47-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' is incomplete and cannot be imported as a stub; its name conflicts with a class in module CompleteSwiftTypes
47+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' is incomplete and cannot be imported as a stub; its name conflicts with a class in module 'CompleteSwiftTypes'
4848
// CHECK-NEXT: @class ConflictingTypeName;
4949
// CHECK-NEXT: ^
5050
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: interface 'ConflictingTypeName' forward declared here
@@ -64,7 +64,7 @@ _ = returnAProtocolConflictingTypeName()
6464
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolConflictingTypeName' is incomplete
6565
// CHECK-NEXT: id<ProtocolConflictingTypeName> returnAProtocolConflictingTypeName();
6666
// CHECK-NEXT: ^
67-
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolConflictingTypeName' is incomplete and cannot be imported as a stub; its name conflicts with a protocol in module CompleteSwiftTypes
67+
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolConflictingTypeName' is incomplete and cannot be imported as a stub; its name conflicts with a protocol in module 'CompleteSwiftTypes'
6868
// CHECK-NEXT: @protocol ProtocolConflictingTypeName;
6969
// CHECK-NEXT: ^
7070
// CHECK-NEXT: objc-library-forward-declaring-complete-swift-types.h:{{[0-9]+}}:{{[0-9]+}}: note: protocol 'ProtocolConflictingTypeName' forward declared here

0 commit comments

Comments
 (0)