diff options
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 3d250e3bef1..10b243cd509 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -2575,11 +2575,12 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx, const MacroDirective *MD = PP.getMacroDirectiveHistory(Macro); assert(MD && "Not a macro?"); const MacroInfo *MI = MD->getMacroInfo(); + assert((!MD->isDefined() || MI) && "missing MacroInfo for define"); Result.AddTypedTextChunk( Result.getAllocator().CopyString(Macro->getName())); - if (!MI->isFunctionLike()) + if (!MI || !MI->isFunctionLike()) return Result.TakeString(); // Format a function-like macro with placeholders for the arguments. |