This patch makes AnalysisBasedWarnings::IssueWarnings return without issuing warnings based on CFG analysis when a fatal error has occurred. This is needed to avoid a crash that occurs when compiling the test case (instantiate-template-fatal-error.cpp).
My first patch made changes in InstantiatingTemplate::InstantiatingTemplate to call hasUncompilableErrorOccurred instead of hasFatalErrorOccurred at SemaTemplateInstantiate.cpp:214. That fixed the crash for the test case but introduced a large number of regression test failures, so I fixed AnalysisBasedWarnings::IssueWarnings instead.
Maybe "Any diagnostics we might have raised will not be visible, and we do not need to construct a correct AST." to justify the two checks?