With the old approach we were updating `ObjCInterfaceType.Decl` to the last encountered definition. But during loading modules `ASTDeclReader::VisitObjCInterfaceDecl` keeps the *first* encountered definition. So with multiple definitions imported there would be a disagreement between expected definition in `ObjCInterfaceType.Decl` and actual definition `ObjCInterfaceDecl::getDefinition` which can lead to incorrect diagnostic. Fix by not tracking definition in `ObjCInterfaceType` explicitly but by getting it from redeclaration chain. Partially reverted 919fc50034b44c48aae8b80283f253ec2ee17f45 keeping the modified test case as the correct behavior is achieved in a different way. Differential Revision: https://reviews.llvm.org/D110452
12 lines
371 B
Objective-C
12 lines
371 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
|
|
// expected-no-diagnostics
|
|
@interface Buggy
|
|
@end
|
|
|
|
@import Foo.Bar;
|
|
|
|
// No diagnostic for inaccessible 'Buggy' definition because we have another definition right in this file.
|
|
@interface Buggy (MyExt)
|
|
@end
|