summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp2
-rw-r--r--clang/test/Index/c-index-unsupported-warning-test.c3
2 files changed, 4 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(),
diff --git a/clang/test/Index/c-index-unsupported-warning-test.c b/clang/test/Index/c-index-unsupported-warning-test.c
new file mode 100644
index 00000000000..82ed06359d7
--- /dev/null
+++ b/clang/test/Index/c-index-unsupported-warning-test.c
@@ -0,0 +1,3 @@
+// RUN: c-index-test -code-completion-at=%s:1:1 -Wunknown-foo-bar-warning -Werror %s
+
+void f();
OpenPOWER on IntegriCloud