Fix a few bugs where we would fail to properly determine header to module correspondence when determining whether to suggest a #include or import, and suggest a #include more often in language modes where there is no import syntax. Generally, if the target is in a header with include guards or #pragma once, we should suggest either #including or importing that header, and not importing a module that happens to textually include it. In passing, improve the notes we attach to the corresponding diagnostics: calling an entity that we couldn't see "previous" is confusing.
12 lines
409 B
Objective-C
12 lines
409 B
Objective-C
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 %s -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F%S/Inputs/interface-diagnose-missing-import -verify
|
|
@interface Buggy
|
|
@end
|
|
|
|
@import Foo.Bar;
|
|
|
|
@interface Buggy (MyExt) // expected-error {{definition of 'Buggy' must be imported from module 'Foo' before it is required}}
|
|
@end
|
|
|
|
// expected-note@Foo/RandoPriv.h:3{{definition here is not reachable}}
|