[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 19:01:20 PDT 2024


================
@@ -1631,13 +1631,39 @@ static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) {
 static NamedDecl* getLambdaCallOperatorHelper(const CXXRecordDecl &RD) {
   if (!RD.isLambda()) return nullptr;
   DeclarationName Name =
-    RD.getASTContext().DeclarationNames.getCXXOperatorName(OO_Call);
-  DeclContext::lookup_result Calls = RD.lookup(Name);
+      RD.getASTContext().DeclarationNames.getCXXOperatorName(OO_Call);
 
+  DeclContext::lookup_result Calls = RD.lookup(Name);
   assert(!Calls.empty() && "Missing lambda call operator!");
   assert(allLookupResultsAreTheSame(Calls) &&
          "More than one lambda call operator!");
-  return Calls.front();
+
+  // If we have multiple call operators, we might be in a situation
----------------
ChuanqiXu9 wrote:

```suggestion
  // FIXME: If we have multiple call operators, we might be in a situation
```

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


More information about the cfe-commits mailing list