Skip to content

Commit

Permalink
Fix constructors called from class struct initializer lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersbakken committed Dec 15, 2016
1 parent 66e1d80 commit ffdf698
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.6)
project(rtags)
set(RTAGS_VERSION_MAJOR 2)
set(RTAGS_VERSION_MINOR 5)
set(RTAGS_VERSION_DATABASE 106)
set(RTAGS_VERSION_DATABASE 107)
set(RTAGS_VERSION_SOURCES_FILE 7)
set(RTAGS_VERSION ${RTAGS_VERSION_MAJOR}.${RTAGS_VERSION_MINOR}.${RTAGS_VERSION_DATABASE})

Expand Down
2 changes: 1 addition & 1 deletion src/ClangIndexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ bool ClangIndexer::handleReference(const CXCursor &cursor, CXCursorKind kind, Lo
if (RTags::isCursor(c->kind))
return true;
auto best = targets.end();
int bestRank = -1;
int bestRank = RTags::targetRank(RTags::targetsValueKind(refTargetValue));
for (auto it = targets.begin(); it != targets.end(); ++it) {
const int r = RTags::targetRank(RTags::targetsValueKind(it->second));
if (r > bestRank || (r == bestRank && RTags::targetsValueIsDefinition(it->second))) {
Expand Down
6 changes: 3 additions & 3 deletions src/RTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,8 @@ inline uint16_t createTargetsValue(const CXCursor &cursor)
inline int targetRank(CXCursorKind kind)
{
switch (kind) {
case CXCursor_Constructor: // this one should be more than class/struct decl
return 1;
case CXCursor_Constructor: // this one should be more than class/struct decl and fielddecl
return 5;
case CXCursor_ClassDecl:
case CXCursor_StructDecl:
case CXCursor_ClassTemplate:
Expand All @@ -613,7 +613,7 @@ inline int targetRank(CXCursorKind kind)
// objects seem to come out as function templates
return 3;
case CXCursor_MacroDefinition:
return 4;
return 5;
default:
return 2;
}
Expand Down

0 comments on commit ffdf698

Please sign in to comment.