Index: clang/lib/Index/USRGeneration.cpp =================================================================== --- clang/lib/Index/USRGeneration.cpp +++ clang/lib/Index/USRGeneration.cpp @@ -893,6 +893,12 @@ T = AT->getElementType(); continue; } + if (const MemberPointerType *MPT = T->getAs()) { + VisitType(QualType(MPT->getClass(), 0)); + Out << "::*"; + T = MPT->getPointeeType(); + continue; + } // Unhandled type. Out << ' '; Index: clang/test/Index/USR/MemberFunctionPtr.cpp =================================================================== --- /dev/null +++ clang/test/Index/USR/MemberFunctionPtr.cpp @@ -0,0 +1,33 @@ +// RUN: c-index-test core -print-source-symbols -- %s | FileCheck %s + +struct C { + int X; + void f(char); +}; + +void f(int C::*) {} +// CHECK: function/C | f | c:@F@f#$@S@C::*I# +void f(void (C::*)(char)) {} +// CHECK: function/C | f | c:@F@f#$@S@C::*Fv(#C)# + +typedef int C::*Xtd; +void ftd(Xtd) {} +// CHECK: function/C | ftd | c:@F@ftd#$@S@C::*I# +typedef void (C::*Ftd)(char); +void ftd(Ftd) {} +// CHECK: function/C | ftd | c:@F@ftd#$@S@C::*Fv(#C)# + +using Xus = int C::*; +void fus(Xus) {} +// CHECK: function/C | fus | c:@F@fus#$@S@C::*I# +using Fus = void (C::*)(char); +void fus(Fus) {} +// CHECK: function/C | fus | c:@F@fus#$@S@C::*Fv(#C)# + +template struct S; +template struct S { + static const bool V = true; + // CHECK: static-property/C++ | V | c:@SP>2#T#T@S>#t0.1::*t0.0@V + void f() {} + // CHECK: instance-method/C++ | f | c:@SP>2#T#T@S>#t0.1::*t0.0@F@f# +};