[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 07:49:37 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:

makes more sense at least, I'd be ok with that.  `known invalid` threw me a bunch, the difference between `the set is invalid` and `the candidates are invalid` is a goofy one, and left me concerned that we were 'collecting' candidates (along with the lack of `const`).

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


More information about the cfe-commits mailing list