diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-08 01:21:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-08 01:21:13 +0000 |
commit | 46e75477bd24a703da11d354587c9bea69d6888f (patch) | |
tree | 1d675c793969bcd6117dd0dee739a265f55a21dc /test/Index/index-refs.cpp | |
parent | 82848c26c896d46c0b98e1776a7781e754a8ee25 (diff) |
[libclang] For CXXOperatorCallExprs, give a valid source location to the DeclRefExpr
that is referencing the member function, so we can index the referenced function.
Fixes rdar://10762375&10324915 & http://llvm.org/PR11192
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/index-refs.cpp')
-rw-r--r-- | test/Index/index-refs.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Index/index-refs.cpp b/test/Index/index-refs.cpp index 0b3c0bc423..00767b061d 100644 --- a/test/Index/index-refs.cpp +++ b/test/Index/index-refs.cpp @@ -18,6 +18,22 @@ enum { SecondVal = EnumVal }; +struct S { + S& operator++(); + int operator*(); + S& operator=(int x); + S& operator!=(int x); + S& operator()(int x); +}; + +void foo2(S &s) { + (void)++s; + (void)*s; + s = 3; + (void)(s != 3); + s(3); +} + // RUN: c-index-test -index-file %s | FileCheck %s // CHECK: [indexDeclaration]: kind: namespace | name: NS // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx @@ -35,3 +51,10 @@ enum { // CHECK-NEXT: [indexDeclaration]: kind: enum // CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: SecondVal // CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal + +// CHECK: [indexDeclaration]: kind: function | name: foo2 +// CHECK: [indexEntityReference]: kind: c++-instance-method | name: operator++ +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator* +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator= +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator!= +// CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator() |