Required in D102159 that we should add support for the unhandled items instead of workaround them.
In this patch, support is added for indexing the type of pointers to class members. Such usages are found in MySQL.
The format is <class index>::*<member index>.
Details
- Reviewers
akyrtzi
Diff Detail
Unit Tests
Time | Test | |
---|---|---|
160 ms | x64 windows > Clang.Index/USR::MemberFunctionPtr.cpp |
Event Timeline
clang/lib/Index/USRGeneration.cpp | ||
---|---|---|
897 | A bit better to do VisitTagDecl(MPT->getClass()), what do you think? |
clang/lib/Index/USRGeneration.cpp | ||
---|---|---|
897 | This was my first version of the patch, which was VisitTagDecl(MPT->getMostRecentCXXRecordDecl()). However, it cannot handle the TemplateTypeParmType type, which is presented in the last two CHECKs of the test case. Call to method MemberPointerType::getMostRecentCXXRecordDecl will dereference a nullptr in the function (getClass()->getAsCXXRecordDecl() returns nullptr) . To fully handle all circumstances, I finally choose to use the VisitType method. |
Update the test case to avoid a crash in the Windows version of the c-index-test tool.
ping
What do you think about this patch? Can it be landed now? Or I should debug the crash in the Windows version detected with the previous version of my patch.
What do you think about this patch? Can it be landed now? Or I should debug the crash in the Windows version detected with the previous version of my patch.
Is your change introducing the crash or is the crash triggered with the test file without your changes as well?
A bit better to do VisitTagDecl(MPT->getClass()), what do you think?