Skip to content

Commit e94f01d

Browse files
authored
Merge pull request #30557 from owenv/verifier-wording-fix
[DiagnosticVerifier] More accurate wording when printing diagnostics from external sources
2 parents 5f8fece + d6a2910 commit e94f01d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/Frontend/DiagnosticVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ void DiagnosticVerifier::printRemainingDiagnostics() const {
755755

756756
SM.getLLVMSourceMgr().PrintMessage(
757757
llvm::errs(), getRawLoc(diag.Loc), SMKind,
758-
"diagnostic produced by Clang: " + diag.Message.str(),
758+
"diagnostic produced elsewhere: " + diag.Message.str(),
759759
/*Ranges=*/{}, {});
760760
}
761761
}

test/Frontend/verify-broken-c-module.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// RUN: not %target-typecheck-verify-swift -I %S/Inputs/broken-c-module 2>&1 | %FileCheck %s
77

88
// CHECK: [[@LINE+3]]:8: error: unexpected error produced: could not build
9-
// CHECK: note: diagnostic produced by Clang: in file included from <module-includes>
10-
// CHECK: broken_c.h:2:11: error: diagnostic produced by Clang: expected function body after function declarator
9+
// CHECK: note: diagnostic produced elsewhere: in file included from <module-includes>
10+
// CHECK: broken_c.h:2:11: error: diagnostic produced elsewhere: expected function body after function declarator
1111
import BrokenCModule

test/Frontend/verify.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ undefinedFunc()
1010

1111
// CHECK: [[@LINE+1]]:20: error: expected {{{{}} in {{expected}}-{{warning}}
1212
// expected-warning
13+
14+
// CHECK: [[@LINE+2]]:8: error: unexpected error produced: generic type 'Array' specialized with too many type parameters
15+
// CHECK: note: diagnostic produced elsewhere: generic type 'Array' declared here
16+
let x: Array<Int, Int>

0 commit comments

Comments
 (0)