Skip to content
Snippets Groups Projects
Commit dcf4119b authored by Wim Lavrijsen's avatar Wim Lavrijsen
Browse files

Cling workaround: special case to resolve string <-> basic_string<char>

parent 1d3b46cc
No related branches found
No related tags found
No related merge requests found
......@@ -504,7 +504,7 @@ Bool_t PyROOT::TCStringConverter::SetArg(
// set the value and declare success
if ( func )
gInterpreter->CallFunc_SetArg( func, reinterpret_cast< Long_t >( fBuffer.c_str() ) );
gInterpreter->CallFunc_SetArg( func, (Long_t)fBuffer.c_str() );
return kTRUE;
}
......
......@@ -230,8 +230,15 @@ int PyROOT::BuildRootClassDict( const TScopeAdapter& klass, PyObject* pyclass )
// special case trackers
Bool_t setupSetItem = kFALSE;
Bool_t isConstructor =
TClassEdit::ShortType( mtName.c_str(), TClassEdit::kDropAlloc ) == clName;
// CLING WORKAROUND --
Bool_t isConstructor = kFALSE;
if ( clName == "string" ) {
isConstructor = mtName == "basic_string<char>";
} else {
// -- CLING WORKAROUND
isConstructor =
TClassEdit::ShortType( mtName.c_str(), TClassEdit::kDropAlloc ) == clName;
}
// filter empty names (happens for namespaces, is bug?)
if ( mtName == "" )
......
......@@ -86,8 +86,10 @@ PyObject* PyROOT::TConstructorHolder::operator()(
// CLING WORKAROUND --
// Due to #100389, the constructor may not be a valid method. This happens if
// there is no (default) contructor, so just return a right-size bit of memory.
if ( ! address )
if ( ! address ) {
PyErr_Clear();
address = (Long_t)klass->New();
}
// -- END CLING WORKAROUND
// done with filtered args
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment