Skip to content
Draft
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
15 changes: 13 additions & 2 deletions clingwrapper/src/clingwrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ Cppyy::TCppType_t Cppyy::GetType(const std::string &name, bool enable_slow_looku
if (auto type = Cpp::GetType(name))
return type;

if (auto type = Cppyy::GetTypeFromScope(Cppyy::GetScope(name)))
return type;

if (!enable_slow_lookup) {
if (name.find("::") != std::string::npos)
throw std::runtime_error("Calling Cppyy::GetType with qualified name '"
Expand Down Expand Up @@ -789,9 +792,16 @@ Cppyy::TCppScope_t Cppyy::GetScope(const std::string& name,

if (Cppyy::IsTemplate(scope)) {
std::vector<Cpp::TemplateArgInfo> templ_params;
if (!Cppyy::AppendTypesSlow(params, templ_params))
return Cpp::InstantiateTemplate(scope, templ_params.data(),
if (!Cppyy::AppendTypesSlow(params, templ_params)) {
scope = Cpp::InstantiateTemplate(scope, templ_params.data(),
templ_params.size());
if (scope) {
std::string attribute = name.substr(end + 1);
if (attribute.size() > 2) // go past ::
Cppyy::GetScope(attribute.substr(2), scope);
return scope;
}
}
}
}
return nullptr;
Expand Down Expand Up @@ -826,6 +836,7 @@ Cppyy::TCppScope_t Cppyy::GetScopeFromType(TCppType_t type)

Cppyy::TCppType_t Cppyy::GetTypeFromScope(TCppScope_t klass)
{
if (!klass) return klass;
return Cpp::GetTypeFromScope(klass);
}

Expand Down