From aaa4e45fa819ad83f70553bc162532199d436217 Mon Sep 17 00:00:00 2001 From: Brent Royal-Gordon Date: Mon, 28 Sep 2020 16:26:30 -0700 Subject: [PATCH] [ClangImporter] Update umbrella header diagnostic handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In apple/llvm-project#1860, the diagnostic for a missing import in an umbrella header was improved by moving it to the end of the file and including a fix-it suggesting the import that would be needed. This breaks two things on the Swift side: • One Swift test assumes the old source location will be used. • The `ClangSourceBufferImporter` doesn’t work correctly when a diagnostic is emitted at EOF. It tries to create a virtual file covering EOF..; diff --git a/test/ClangImporter/diags_from_module.swift b/test/ClangImporter/diags_from_module.swift index 8e74e7a8ca062..5cc81a87e1291 100644 --- a/test/ClangImporter/diags_from_module.swift +++ b/test/ClangImporter/diags_from_module.swift @@ -37,7 +37,7 @@ import Module // CHECK-PRIMARY: diags_from_module.swift:[[@LINE-4]]:8: error: could not build Objective-C module 'Module' // CHECK-WARN: Sub2.h:7:2: warning: here is some warning about something -// CHECK-WARN: :1:1: warning: umbrella header for module 'Module' does not include header 'NotInModule.h' +// CHECK-WARN: Module.h:20:1: warning: umbrella header for module 'Module' does not include header 'NotInModule.h' // FIXME: show [-Wincomplete-umbrella] // CHECK-NO-WARN-NOT: warning about something