mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 01:21:57 +00:00
[indexer] Treat explicit destructor call as not is_implicit
(#159)
Also fixed an unused warning.
This commit is contained in:
parent
0cf54f3557
commit
5600989a42
@ -1443,6 +1443,10 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) {
|
|||||||
// or implicit), but libclang only supports implicit for objective-c.
|
// or implicit), but libclang only supports implicit for objective-c.
|
||||||
bool is_implicit =
|
bool is_implicit =
|
||||||
CanBeCalledImplicitly(ref->referencedEntity->kind) &&
|
CanBeCalledImplicitly(ref->referencedEntity->kind) &&
|
||||||
|
// For explicit destructor call, ref->cursor may be "~" while called->def.short_name is "~A"
|
||||||
|
// "~A" is not a substring of ref->cursor, but we should take this case as not `is_implicit`.
|
||||||
|
called->def.short_name.size() && called->def.short_name[0] != '~' &&
|
||||||
|
|
||||||
!CursorSpellingContainsString(ref->cursor, param->tu->cx_tu,
|
!CursorSpellingContainsString(ref->cursor, param->tu->cx_tu,
|
||||||
called->def.short_name);
|
called->def.short_name);
|
||||||
|
|
||||||
|
@ -342,9 +342,7 @@ out_error:
|
|||||||
|
|
||||||
bool IsSymLink(const std::string& path) {
|
bool IsSymLink(const std::string& path) {
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
int result;
|
return lstat(path.c_str(), &buf) == 0 && S_ISLNK(buf.st_mode);
|
||||||
result = lstat(path.c_str(), &buf);
|
|
||||||
return S_ISLNK(buf.st_mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> GetPlatformClangArguments() {
|
std::vector<std::string> GetPlatformClangArguments() {
|
||||||
|
Loading…
Reference in New Issue
Block a user