Skip to content

Remove name param from LookupConstructors #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions lib/Interpreter/CppInterOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1043,19 +1043,15 @@ namespace Cpp {
}

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

if (auto* CXXRD = llvm::dyn_cast_or_null<CXXRecordDecl>(D)) {
getSema().ForceDeclarationOfImplicitMembers(CXXRD);
DeclContextLookupResult Result = getSema().LookupConstructors(CXXRD);
// Obtaining all constructors when we intend to lookup a method under a
// scope can lead to crashes. We avoid that by accumulating constructors
// only if the Decl matches the lookup name.
for (auto* i : Result)
if (GetName(i) == name)
funcs.push_back(i);
funcs.push_back(i);
}
}

Expand Down
Loading