We currenltly assert when want to diagnose a missing import and the decl in question is already visible. It turns out that the decl in question might be visible because another decl from the same module actually made the module visible in a previous error diagnostic. Remove the assertion and avoid re-exporting the module if it's already visible. rdar://problem/27975402 Differential Revision: https://reviews.llvm.org/D32828 llvm-svn: 303705
15 lines
898 B
Objective-C
15 lines
898 B
Objective-C
// RUN: rm -rf %t
|
|
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/diagnose-missing-import \
|
|
// RUN: -Werror=implicit-function-declaration -fsyntax-only \
|
|
// RUN: -fimplicit-module-maps -verify %s
|
|
@import NCI;
|
|
|
|
void foo() {
|
|
XYZLogEvent(xyzRiskyCloseOpenParam, xyzRiskyCloseOpenParam); // expected-error {{implicit declaration of function 'XYZLogEvent'}} expected-error {{declaration of 'XYZLogEvent' must be imported}} expected-error {{declaration of 'xyzRiskyCloseOpenParam' must be imported from module 'NCI.A'}} expected-error {{declaration of 'xyzRiskyCloseOpenParam' must be imported from module 'NCI.A'}}
|
|
}
|
|
|
|
// expected-note@Inputs/diagnose-missing-import/a.h:5 {{previous declaration is here}}
|
|
// expected-note@Inputs/diagnose-missing-import/a.h:5 {{previous declaration is here}}
|
|
// expected-note@Inputs/diagnose-missing-import/a.h:6 {{previous declaration is here}}
|
|
|