aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index a573fb41ab..b54162f8d7 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -191,10 +191,14 @@ void ASTUnit::CacheCodeCompletionResults() {
Ctx->getLangOptions());
CachedResult.Priority = Results[I].Priority;
CachedResult.Kind = Results[I].CursorKind;
- CachedResult.TypeClass
- = getSimplifiedTypeClass(
- Ctx->getCanonicalType(getDeclUsageType(*Ctx,
- Results[I].Declaration)));
+
+ QualType UsageType = getDeclUsageType(*Ctx, Results[I].Declaration);
+ if (UsageType.isNull())
+ CachedResult.TypeClass = STC_Void;
+ else {
+ CachedResult.TypeClass
+ = getSimplifiedTypeClass(Ctx->getCanonicalType(UsageType));
+ }
CachedCompletionResults.push_back(CachedResult);
break;
}