Don't index initializer for lambda types

This commit is contained in:
Fangrui Song 2018-01-17 21:02:09 -08:00
parent b5761b5980
commit ca3784db03

View File

@ -437,14 +437,17 @@ void SetVarDetail(IndexVar* var,
} else { } else {
def.detailed_name = std::move(type_name); def.detailed_name = std::move(type_name);
ConcatTypeAndName(def.detailed_name, qualified_name); ConcatTypeAndName(def.detailed_name, qualified_name);
// The following check is used to skip inside-out syntax and array types // Append the textual initializer, bit field, constructor to |hover|.
// which we can't display well. // Omit |hover| for these types:
// For other types, append the textual initializer, bit field, constructor // int (*a)(); int (&a)(); int (&&a)(); int a[1]; auto x = ...
// or whatever. // We can take these into consideration after we have better support for
// inside-out syntax.
CXType deref = cx_type; CXType deref = cx_type;
while (deref.kind == CXType_Pointer || deref.kind == CXType_MemberPointer) while (deref.kind == CXType_Pointer || deref.kind == CXType_MemberPointer ||
deref.kind == CXType_LValueReference ||
deref.kind == CXType_RValueReference)
deref = clang_getPointeeType(deref); deref = clang_getPointeeType(deref);
if (deref.kind != CXType_Unexposed && if (deref.kind != CXType_Unexposed && deref.kind != CXType_Auto &&
clang_getResultType(deref).kind == CXType_Invalid && clang_getResultType(deref).kind == CXType_Invalid &&
clang_getElementType(deref).kind == CXType_Invalid) { clang_getElementType(deref).kind == CXType_Invalid) {
const FileContents& fc = param->file_contents[db->path]; const FileContents& fc = param->file_contents[db->path];