Skip to content

Commit 7387021

Browse files
committed
Update template function selection to use min required args on clang-repl
1 parent e0fa91e commit 7387021

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Interpreter/CppInterOp.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,11 +993,17 @@ namespace Cpp {
993993
// actual types. We make this match solely based on count
994994

995995
const FunctionDecl* func = TFD->getTemplatedDecl();
996-
if (func->getNumParams() != arg_types.size())
996+
997+
#ifdef USE_CLING
998+
if (func->getNumParams() > arg_types.size())
997999
continue;
1000+
#else // CLANG_REPL
1001+
if (func->getMinRequiredArguments() > arg_types.size())
1002+
continue;
1003+
#endif
9981004

9991005
// FIXME : first score based on the type similarity before forcing
1000-
// instantiation try instantiating
1006+
// instantiation.
10011007
TCppFunction_t instantiated =
10021008
InstantiateTemplate(candidate, arg_types.data(), arg_types.size());
10031009
if (instantiated)

0 commit comments

Comments
 (0)