@@ -751,31 +751,26 @@ static bool AddTypeName(std::vector<Cpp::TemplateArgInfo>& types, PyObject* tn,
751751 }
752752
753753 if (CPPScope_Check (tn)) {
754- auto cpp_type = Cppyy::GetTypeFromScope (((CPPClass*)tn)->fCppType );
755- types.push_back (cpp_type);
756- if (arg) {
754+ auto cpp_type = Cppyy::GetTypeFromScope (((CPPClass*)tn)->fCppType );
755+ if (arg) {
757756 // try to specialize the type match for the given object
758757 CPPInstance* pyobj = (CPPInstance*)arg;
759758 if (CPPInstance_Check (pyobj)) {
760759 if (pyobj->fFlags & CPPInstance::kIsRValue )
761- // tmpl_name.append("&&");
762- // FIXME: add r-value reference to the last added type
763- types;
760+ cpp_type =
761+ Cppyy::GetReferencedType (cpp_type, /* rvalue=*/ true );
764762 else {
765763 if (pcnt) *pcnt += 1 ;
766764 if ((pyobj->fFlags & CPPInstance::kIsReference ) || pref == kPointer )
767- // tmpl_name.push_back('*');
768- // FIXME: wrap the last added type in a pointer
769- types;
765+ cpp_type = Cppyy::GetPointerType (cpp_type);
770766 else if (pref != kValue )
771- // tmpl_name.push_back('&');
772- // FIXME: add l-value reference to the last added type
773- types;
767+ cpp_type =
768+ Cppyy::GetReferencedType (cpp_type, /* rvalue=*/ false );
774769 }
775770 }
776- }
777-
778- return true ;
771+ }
772+ types. push_back (cpp_type);
773+ return true ;
779774 }
780775
781776 if (tn == (PyObject*)&CPPOverload_Type) {
@@ -810,8 +805,8 @@ static bool AddTypeName(std::vector<Cpp::TemplateArgInfo>& types, PyObject* tn,
810805 tpn << ' )' ;
811806 // tmpl_name.append(tpn.str());
812807 // FIXME: find a way to add it to types
813- throw std::runtime_error (" This path is not yet implemented (AddTypeName) \n " );
814- types ;
808+ throw std::runtime_error (
809+ " This path is not yet implemented (AddTypeName) \n " ) ;
815810
816811 return true ;
817812
0 commit comments