forked from OSchip/llvm-project
Modules: revert r280728.
In post-commit review, Richard suggested a better way to fix this. rdar://27926200 llvm-svn: 281078
This commit is contained in:
parent
36efbfa6d8
commit
7d2f5c4a91
|
@ -1413,6 +1413,10 @@ DeclContext::lookup(DeclarationName Name) const {
|
|||
assert(DeclKind != Decl::LinkageSpec && DeclKind != Decl::Export &&
|
||||
"should not perform lookups into transparent contexts");
|
||||
|
||||
const DeclContext *PrimaryContext = getPrimaryContext();
|
||||
if (PrimaryContext != this)
|
||||
return PrimaryContext->lookup(Name);
|
||||
|
||||
// If we have an external source, ensure that any later redeclarations of this
|
||||
// context have been loaded, since they may add names to the result of this
|
||||
// lookup (or add external visible storage).
|
||||
|
@ -1420,12 +1424,6 @@ DeclContext::lookup(DeclarationName Name) const {
|
|||
if (Source)
|
||||
(void)cast<Decl>(this)->getMostRecentDecl();
|
||||
|
||||
// getMostRecentDecl can change the result of getPrimaryContext. Call
|
||||
// getPrimaryContext afterwards.
|
||||
const DeclContext *PrimaryContext = getPrimaryContext();
|
||||
if (PrimaryContext != this)
|
||||
return PrimaryContext->lookup(Name);
|
||||
|
||||
if (hasExternalVisibleStorage()) {
|
||||
assert(Source && "external visible storage but no external source?");
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
@interface BaseInterface
|
||||
- (void) test;
|
||||
@end
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#include "Base.h"
|
||||
@interface DerivedInterface : BaseInterface
|
||||
@end
|
|
@ -1 +0,0 @@
|
|||
#include "Base.h"
|
|
@ -1,4 +0,0 @@
|
|||
module X {
|
||||
header "H3.h"
|
||||
export *
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// RUN: rm -rf %t
|
||||
// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert %s -verify
|
||||
// expected-no-diagnostics
|
||||
|
||||
#include "Derive.h"
|
||||
#import <H3.h>
|
||||
@implementation DerivedInterface
|
||||
- (void)test {
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue