Skip to content

[DiagnosticVerifier] More accurate wording when printing diagnostics from external sources #30557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Frontend/DiagnosticVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ void DiagnosticVerifier::printRemainingDiagnostics() const {

SM.getLLVMSourceMgr().PrintMessage(
llvm::errs(), getRawLoc(diag.Loc), SMKind,
"diagnostic produced by Clang: " + diag.Message.str(),
"diagnostic produced elsewhere: " + diag.Message.str(),
/*Ranges=*/{}, {});
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/Frontend/verify-broken-c-module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
// RUN: not %target-typecheck-verify-swift -I %S/Inputs/broken-c-module 2>&1 | %FileCheck %s

// CHECK: [[@LINE+3]]:8: error: unexpected error produced: could not build
// CHECK: note: diagnostic produced by Clang: in file included from <module-includes>
// CHECK: broken_c.h:2:11: error: diagnostic produced by Clang: expected function body after function declarator
// CHECK: note: diagnostic produced elsewhere: in file included from <module-includes>
// CHECK: broken_c.h:2:11: error: diagnostic produced elsewhere: expected function body after function declarator
import BrokenCModule
4 changes: 4 additions & 0 deletions test/Frontend/verify.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ undefinedFunc()

// CHECK: [[@LINE+1]]:20: error: expected {{{{}} in {{expected}}-{{warning}}
// expected-warning

// CHECK: [[@LINE+2]]:8: error: unexpected error produced: generic type 'Array' specialized with too many type parameters
// CHECK: note: diagnostic produced elsewhere: generic type 'Array' declared here
let x: Array<Int, Int>