Skip to content

Commit 9e2a44b

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 a2951c6 commit 9e2a44b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/Interpreter/CppInterOp.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,19 +1147,15 @@ namespace Cpp {
11471147
}
11481148

11491149
// Looks up all constructors in the current DeclContext
1150-
void LookupConstructors(const std::string& name, TCppScope_t parent,
1150+
void LookupConstructors(const std::string&, TCppScope_t parent,
11511151
std::vector<TCppFunction_t>& funcs) {
11521152
auto* D = (Decl*)parent;
11531153

11541154
if (auto* CXXRD = llvm::dyn_cast_or_null<CXXRecordDecl>(D)) {
11551155
getSema().ForceDeclarationOfImplicitMembers(CXXRD);
11561156
DeclContextLookupResult Result = getSema().LookupConstructors(CXXRD);
1157-
// Obtaining all constructors when we intend to lookup a method under a
1158-
// scope can lead to crashes. We avoid that by accumulating constructors
1159-
// only if the Decl matches the lookup name.
11601157
for (auto* i : Result)
1161-
if (GetName(i) == name)
1162-
funcs.push_back(i);
1158+
funcs.push_back(i);
11631159
}
11641160
}
11651161

0 commit comments

Comments
 (0)