Fix crash in libclang if code completion is used with unknown flags.
Use CaptureDroppedDiagnostics to make sure that there is a diagnostic client installed when warning flags are parsed. llvm-svn: 186582
This commit is contained in:
@@ -2410,10 +2410,10 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column,
|
||||
|
||||
// Set up diagnostics, capturing any diagnostics produced.
|
||||
Clang->setDiagnostics(&Diag);
|
||||
ProcessWarningOptions(Diag, CCInvocation->getDiagnosticOpts());
|
||||
CaptureDroppedDiagnostics Capture(true,
|
||||
Clang->getDiagnostics(),
|
||||
StoredDiagnostics);
|
||||
ProcessWarningOptions(Diag, CCInvocation->getDiagnosticOpts());
|
||||
|
||||
// Create the target instance.
|
||||
Clang->setTarget(TargetInfo::CreateTargetInfo(Clang->getDiagnostics(),
|
||||
|
||||
Reference in New Issue
Block a user