forked from OSchip/llvm-project
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:
parent
655bd0d08c
commit
be0474c047
|
@ -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(),
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
// RUN: c-index-test -code-completion-at=%s:1:1 -Wunknown-foo-bar-warning -Werror %s
|
||||
|
||||
void f();
|
Loading…
Reference in New Issue