[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:13 PDT 2026


================
@@ -14612,18 +14612,31 @@ static bool canBeDeclaredInNamespace(const DeclarationName &Name) {
 
 /// Attempt to recover from an ill-formed use of a non-dependent name in a
 /// template, where the non-dependent name was declared after the template
-/// was defined. This is common in code written for a compilers which do not
+/// was defined. This is common in code written for compilers which do not
 /// correctly implement two-stage name lookup.
 ///
 /// Returns true if a viable candidate was found and a diagnostic was issued.
 static bool DiagnoseTwoPhaseLookup(
     Sema &SemaRef, SourceLocation FnLoc, const CXXScopeSpec &SS,
     LookupResult &R, OverloadCandidateSet::CandidateSetKind CSK,
+    OverloadCandidateSet &KnownInvalidCandidateSet,
----------------
erichkeane wrote:

Oh, ok.  I see part of my confusion.  `KnownInvalidCandidateSet` is the set ITSELF that is invalid, not that it is a collection of only invalid candidates?  

Why is this not a `const` ref?  It doesn't appear that we are modifying it here, are we (part of my confusion is it looked like we were 'collecting' this)? 

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


More information about the cfe-commits mailing list