Skip to content

Commit 6ff948f

Browse files
authored
Merge pull request #8147 from d-ronnqvist/SR-2409
[SR-2409] Rephrase diagnostic to consider Objective-C interop
2 parents f4f5d1d + d7c1f57 commit 6ff948f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ NOTE(note_from_clang,none,
4444
"%0", (StringRef))
4545

4646
ERROR(clang_cannot_build_module,Fatal,
47-
"could not build Objective-C module '%0'", (StringRef))
47+
"could not build %select{C|Objective-C}0 module '%1'", (bool, StringRef))
4848

4949
ERROR(bridging_header_missing,Fatal,
5050
"bridging header '%0' does not exist", (StringRef))

lib/ClangImporter/ClangDiagnosticConsumer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ void ClangDiagnosticConsumer::HandleDiagnostic(
173173
clangDiag.getLocation());
174174

175175
ctx.Diags.diagnose(loc, diag::clang_cannot_build_module,
176+
ctx.LangOpts.EnableObjCInterop,
176177
CurrentImport->getName());
177178
return;
178179
}

test/ClangImporter/non-modular-include.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// RUN: rm -rf %t && mkdir -p %t
2-
// RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | %FileCheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/non-modular -F %S/Inputs/non-modular 2>&1 | %FileCheck --check-prefix=CHECK --check-prefix=CHECK-%target-runtime %s
33

44
// CHECK: {{.+}}/non-modular/Foo.framework/Headers/Foo.h:1:9: error: include of non-modular header inside framework module 'Foo'
5-
// CHECK: error: could not build Objective-C module 'Foo'
5+
// CHECK-objc: error: could not build Objective-C module 'Foo'
6+
// CHECK-native: error: could not build C module 'Foo'
67
// CHECK-NOT: error
78

89
import Foo

0 commit comments

Comments
 (0)