mirror of https://github.com/microsoft/clang.git
[Sema] UsingShadowDecl shouldn't be hidden by the UsingDecl that owns it
rdar://23454249 Differential Revision: https://reviews.llvm.org/D28514 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4dac827e73
commit
f40cbc811c
|
@ -3428,6 +3428,12 @@ NamedDecl *VisibleDeclsRecord::checkHidden(NamedDecl *ND) {
|
|||
SM == ShadowMaps.rbegin())
|
||||
continue;
|
||||
|
||||
// A shadow declaration that's created by a resolved using declaration
|
||||
// is not hidden by the same using declaration.
|
||||
if (isa<UsingShadowDecl>(ND) && isa<UsingDecl>(D) &&
|
||||
cast<UsingShadowDecl>(ND)->getUsingDecl() == D)
|
||||
continue;
|
||||
|
||||
// We've found a declaration that hides this one.
|
||||
return D;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Note: the run lines follow their respective tests, since line/column
|
||||
// matter in this test.
|
||||
|
||||
namespace SomeNamespace {
|
||||
class SomeClass {
|
||||
};
|
||||
void SomeFunction();
|
||||
}
|
||||
|
||||
using SomeNamespace::SomeClass;
|
||||
using SomeNamespace::SomeFunction;
|
||||
|
||||
static void foo() {
|
||||
return;
|
||||
}
|
||||
|
||||
// rdar://23454249
|
||||
|
||||
// RUN: c-index-test -code-completion-at=%s:14:3 %s | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_COMPLETION_CACHING=1 c-index-test -code-completion-at=%s:14:3 %s | FileCheck -check-prefix=CHECK-CC1 %s
|
||||
|
||||
// CHECK-CC1: ClassDecl:{TypedText SomeClass} (50)
|
||||
// CHECK-CC1: FunctionDecl:{ResultType void}{TypedText SomeFunction}{LeftParen (}{RightParen )} (50)
|
||||
// CHECK-CC1-NOT: {Text SomeNamespace::}{TypedText SomeClass}
|
||||
// CHECK-CC1-NOT: {Text SomeNamespace::}{TypedText SomeFunction}
|
Loading…
Reference in New Issue