File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -2339,9 +2339,6 @@ namespace {
23392339
23402340 // Make sure the synthesized decl can be found by lookupDirect.
23412341 result->addMemberToLookupTable (opFuncDecl);
2342-
2343- addEntryToLookupTable (*Impl.findLookupTable (decl), cxxMethod,
2344- Impl.getNameImporter ());
23452342 }
23462343 }
23472344 methods.push_back (MD);
@@ -3005,6 +3002,21 @@ namespace {
30053002 if (isSpecializationDepthGreaterThan (def, 8 ))
30063003 return nullptr ;
30073004
3005+ // For class template instantiations, we need to add their member
3006+ // operators to the lookup table to make them discoverable with
3007+ // unqualified lookup. This makes it possible to implement a Swift
3008+ // protocol requirement with an instantiation of a C++ member operator.
3009+ // This cannot be done when building the lookup table,
3010+ // because templates are instantiated lazily.
3011+ for (auto member : def->decls ()) {
3012+ if (auto method = dyn_cast<clang::CXXMethodDecl>(member)) {
3013+ if (method->isOverloadedOperator ()) {
3014+ addEntryToLookupTable (*Impl.findLookupTable (decl), method,
3015+ Impl.getNameImporter ());
3016+ }
3017+ }
3018+ }
3019+
30083020 return VisitCXXRecordDecl (def);
30093021 }
30103022
You can’t perform that action at this time.
0 commit comments