[clang] [Clang] Avoid unnecessary overload resolution when building RecoveryExpr (PR #222296)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 06:29:12 PDT 2026


================
@@ -14634,8 +14647,13 @@ static bool DiagnoseTwoPhaseLookup(
       R.suppressDiagnostics();
 
       OverloadCandidateSet Candidates(FnLoc, CSK);
-      SemaRef.AddOverloadedCallCandidates(R, ExplicitTemplateArgs, Args,
-                                          Candidates);
+      for (LookupResult::iterator I = R.begin(), E = R.end(); I != E; ++I) {
+        if (InvalidCandidates.contains(I->getAsFunction()))
----------------
erichkeane wrote:

I wonder if doing the `.exclude` function on the 2nd candidate set would be more effective? I THINK you can actually do it in advance of the call to `LookupQualifiedName` to just suppress them there? 

https://github.com/llvm/llvm-project/pull/222296


More information about the cfe-commits mailing list