7a35c2ddbc
Sema::AddTemplateOverloadCandidate() can issue diagnostics as part of the template instantiation it performs. The LookupHelper just wants to know whether there is a matching function, which is similar to a SFINAE context and a good reason to silence potential diagnostics if asked to do so! Do get there, simple increase the scope of the setSuppressAllDiagnostics() calls, and make it an RAII for robustness.