forked from OSchip/llvm-project
Teach code completion not to ignore data members when performing code
completion for expressions. llvm-svn: 106037
This commit is contained in:
parent
9eb41c35ce
commit
9858ed5b69
|
@ -790,7 +790,7 @@ bool ResultBuilder::IsOrdinaryName(NamedDecl *ND) const {
|
|||
|
||||
unsigned IDNS = Decl::IDNS_Ordinary;
|
||||
if (SemaRef.getLangOptions().CPlusPlus)
|
||||
IDNS |= Decl::IDNS_Tag | Decl::IDNS_Namespace;
|
||||
IDNS |= Decl::IDNS_Tag | Decl::IDNS_Namespace | Decl::IDNS_Member;
|
||||
else if (SemaRef.getLangOptions().ObjC1 && isa<ObjCIvarDecl>(ND))
|
||||
return true;
|
||||
|
||||
|
@ -806,7 +806,7 @@ bool ResultBuilder::IsOrdinaryNonTypeName(NamedDecl *ND) const {
|
|||
|
||||
unsigned IDNS = Decl::IDNS_Ordinary;
|
||||
if (SemaRef.getLangOptions().CPlusPlus)
|
||||
IDNS |= Decl::IDNS_Tag | Decl::IDNS_Namespace;
|
||||
IDNS |= Decl::IDNS_Tag | Decl::IDNS_Namespace | Decl::IDNS_Member;
|
||||
else if (SemaRef.getLangOptions().ObjC1 && isa<ObjCIvarDecl>(ND))
|
||||
return true;
|
||||
|
||||
|
|
|
@ -33,6 +33,10 @@ void test_overloaded() {
|
|||
overloaded(Z(), 0);
|
||||
}
|
||||
|
||||
Z::operator int() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CHECK-MEMBER: FieldDecl:{ResultType double}{TypedText member}
|
||||
// CHECK-MEMBER: FieldDecl:{ResultType int}{Text X::}{TypedText member}
|
||||
// CHECK-MEMBER: FieldDecl:{ResultType float}{Text Y::}{TypedText member}
|
||||
|
@ -52,3 +56,12 @@ void test_overloaded() {
|
|||
// CHECK-OVERLOAD: NotImplemented:{ResultType int &}{Text overloaded}{LeftParen (}{Text Z z}{Comma , }{CurrentParameter int second}{RightParen )}
|
||||
// CHECK-OVERLOAD: NotImplemented:{ResultType float &}{Text overloaded}{LeftParen (}{Text int i}{Comma , }{CurrentParameter long second}{RightParen )}
|
||||
// CHECK-OVERLOAD: NotImplemented:{ResultType double &}{Text overloaded}{LeftParen (}{Text float f}{Comma , }{CurrentParameter int second}{RightParen )}
|
||||
|
||||
// RUN: c-index-test -code-completion-at=%s:37:10 %s | FileCheck -check-prefix=CHECK-EXPR %s
|
||||
// CHECK-EXPR: NotImplemented:{TypedText int} (40)
|
||||
// CHECK-EXPR: NotImplemented:{TypedText long} (40)
|
||||
// CHECK-EXPR: FieldDecl:{ResultType double}{TypedText member} (10)
|
||||
// CHECK-EXPR: FieldDecl:{ResultType int}{Text X::}{TypedText member} (5)
|
||||
// CHECK-EXPR: FieldDecl:{ResultType float}{Text Y::}{TypedText member} (11)
|
||||
// CHECK-EXPR: FunctionDecl:{ResultType void}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )} (22)
|
||||
|
||||
|
|
Loading…
Reference in New Issue