Skip to content

Commit

Permalink
Update template function selection to use min required args on clang-…
Browse files Browse the repository at this point in the history
…repl
  • Loading branch information
aaronj0 committed Jul 12, 2024
1 parent e0fa91e commit 7387021
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Interpreter/CppInterOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,11 +993,17 @@ namespace Cpp {
// actual types. We make this match solely based on count

const FunctionDecl* func = TFD->getTemplatedDecl();
if (func->getNumParams() != arg_types.size())

#ifdef USE_CLING
if (func->getNumParams() > arg_types.size())
continue;
#else // CLANG_REPL
if (func->getMinRequiredArguments() > arg_types.size())
continue;

Check warning on line 1002 in lib/Interpreter/CppInterOp.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Interpreter/CppInterOp.cpp#L1001-L1002

Added lines #L1001 - L1002 were not covered by tests
#endif

// FIXME : first score based on the type similarity before forcing
// instantiation try instantiating
// instantiation.
TCppFunction_t instantiated =
InstantiateTemplate(candidate, arg_types.data(), arg_types.size());
if (instantiated)
Expand Down

0 comments on commit 7387021

Please sign in to comment.