Skip to content

Commit 7da68cf

Browse files
committed
Remove name check from LookupConstructors
This parameter required the unscoped type name, but CppInterOp provides no way of getting that. Every usage of this appears to have a hard-coded type name instead. After speaking with Vassil on Discord, he suggested this additional check may not actually be needed. For now, the param has been kept, to not break existing code. If everything works correctly, we can follow up to remove the param entirely. If this param cannot be removed, please provide a way for the unscoped name to be accessed via CppInterOp.
1 parent 5c1e27a commit 7da68cf

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/Interpreter/CppInterOp.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -1043,19 +1043,15 @@ namespace Cpp {
10431043
}
10441044

10451045
// Looks up all constructors in the current DeclContext
1046-
void LookupConstructors(const std::string& name, TCppScope_t parent,
1046+
void LookupConstructors(const std::string&, TCppScope_t parent,
10471047
std::vector<TCppFunction_t>& funcs) {
10481048
auto* D = (Decl*)parent;
10491049

10501050
if (auto* CXXRD = llvm::dyn_cast_or_null<CXXRecordDecl>(D)) {
10511051
getSema().ForceDeclarationOfImplicitMembers(CXXRD);
10521052
DeclContextLookupResult Result = getSema().LookupConstructors(CXXRD);
1053-
// Obtaining all constructors when we intend to lookup a method under a
1054-
// scope can lead to crashes. We avoid that by accumulating constructors
1055-
// only if the Decl matches the lookup name.
10561053
for (auto* i : Result)
1057-
if (GetName(i) == name)
1058-
funcs.push_back(i);
1054+
funcs.push_back(i);
10591055
}
10601056
}
10611057

0 commit comments

Comments
 (0)