[clang] [clang][Sema] Fix particular operator overload crash (PR #105976)

Nicolas van Kempen via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 12:26:20 PDT 2024


================
@@ -7425,6 +7425,13 @@ void Sema::AddMethodCandidate(DeclAccessPair FoundDecl, QualType ObjectType,
                                /*ExplicitArgs*/ nullptr, ObjectType,
                                ObjectClassification, Args, CandidateSet,
                                SuppressUserConversions, false, PO);
+  } else if (UsingDecl *UD = dyn_cast<UsingDecl>(Decl)) {
+    for (auto *Shadow : UD->shadows()) {
+      AddMethodCandidate(cast<CXXMethodDecl>(Shadow->getTargetDecl()),
+                         FoundDecl, ActingContext, ObjectType,
+                         ObjectClassification, Args, CandidateSet,
+                         SuppressUserConversions, false, std::nullopt, PO);
----------------
nicovank wrote:

Thanks, correct, template operators still cause a crash. I'll spend a bit of time digging into the original problematic commit.

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


More information about the cfe-commits mailing list