Once we've emitted a fatal diagnostic, keep counting errors but with a
separate count of "suppressed" errors. This way, semantic analysis
bits that depend on the error count to determine whether problems
occured (e.g., some template argument deduction failures, jump-scope
checking) will not get confused.

The actual problem here is that a missing #include (which is a fatal
error) could cause the jump-scope checker to run on invalid code,
which it is not prepared to do. Trivial fix for both
<rdar://problem/7775941> and <rdar://problem/7775709>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101297 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/missing-header.cpp b/test/SemaCXX/missing-header.cpp
new file mode 100644
index 0000000..f436579
--- /dev/null
+++ b/test/SemaCXX/missing-header.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+#include "not exist" // expected-error{{'not exist' file not found}}
+
+class AnalysisContext {};
+static ControlFlowKind CheckFallThrough(AnalysisContext &AC) {
+  if (const AsmStmt *AS = dyn_cast<AsmStmt>(S)) {}
+  bool NoReturnEdge = false;
+}