summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-07-18 14:23:12 +0000
committerManuel Klimek <klimek@google.com>2013-07-18 14:23:12 +0000
commitbe0474c047b1cb01225494ccb3210d501490685c (patch)
treec418f81fc92b19ad8269ea7d763399b81e157c59 /clang/lib/Frontend/ASTUnit.cpp
parent655bd0d08ca6df5898c9e64bd00ea39841932edb (diff)
downloadbcm5719-llvm-be0474c047b1cb01225494ccb3210d501490685c.tar.gz
bcm5719-llvm-be0474c047b1cb01225494ccb3210d501490685c.zip
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
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index c1f6bc5bb0e..9251fc0daa0 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -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(),
OpenPOWER on IntegriCloud