From 95e144a41dfe9310b7fa7aa14de283670830a031 Mon Sep 17 00:00:00 2001 From: maximusron Date: Thu, 4 Apr 2024 12:51:13 +0200 Subject: [PATCH] update Cpp::GetTemplatedMethods usage --- clingwrapper/src/clingwrapper.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clingwrapper/src/clingwrapper.cxx b/clingwrapper/src/clingwrapper.cxx index fd5b1ffa..9b466425 100644 --- a/clingwrapper/src/clingwrapper.cxx +++ b/clingwrapper/src/clingwrapper.cxx @@ -1431,7 +1431,10 @@ std::string Cppyy::GetTemplatedMethodName(TCppScope_t scope, TCppIndex_t imeth) { std::vector mc; Cpp::GetFunctionTemplatedDecls(scope, mc); - return GetMethodName(mc[imeth]); + + if (imeth < mc.size()) return GetMethodName(mc[imeth]); + + return ""; } // @@ -1491,7 +1494,7 @@ Cppyy::TCppMethod_t Cppyy::GetMethodTemplate( else pureName = name; - std::vector unresolved_candidate_methods = Cpp::GetTemplatedMethods(pureName, scope, proto); + std::vector unresolved_candidate_methods = Cpp::GetTemplatedMethods(pureName, scope); // take the vector of decls(unresolved candidates set), pass that along with type sets to Clang