Skip to content

Commit

Permalink
In BuildOld, don't make all unique_ptr as having -> in comment.
Browse files Browse the repository at this point in the history
unique_ptr can be nullptr too sometimes *and* anyway TStreamerInfo::Build does not make the same restriction.
The mismatch lead to baffling error message like:

Warning in <TStreamerInfo::BuildOld>: Cannot convert A::h from type: B to type: B, skip element

This solves one of the problems seen in https://sft.its.cern.ch/jira/browse/ROOT-9702.
  • Loading branch information
pcanal committed Mar 19, 2019
1 parent 76e4cd2 commit be1399c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions io/io/src/TStreamerInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,6 @@ void TStreamerInfo::BuildOld()
std::string typeNameBuf;
const char* dmType = nullptr;
Bool_t dmIsPtr = false;
Bool_t isUniquePtr = false;
TDataType* dt(nullptr);
Int_t ndim = 0 ; //dm->GetArrayDim();
std::array<Int_t, 5> maxIndices; // 5 is the maximum supported in TStreamerElement::SetMaxIndex
Expand Down Expand Up @@ -2012,7 +2011,7 @@ void TStreamerInfo::BuildOld()
Bool_t nameChanged;
typeNameBuf = TClassEdit::GetNameForIO(dmType, TClassEdit::EModType::kNone, &nameChanged);
if (nameChanged) {
isUniquePtr = dmIsPtr = TClassEdit::IsUniquePtr(dmType);
dmIsPtr = TClassEdit::IsUniquePtr(dmType);
dmType = typeNameBuf.c_str();
}
if ((isStdArray = TClassEdit::IsStdArray(dmType))){ // We tackle the std array case
Expand Down Expand Up @@ -2257,7 +2256,7 @@ void TStreamerInfo::BuildOld()
if (element->GetNewType() != -2) {
if (dm) {
if (dmIsPtr) {
if (isUniquePtr || strncmp(dm->GetTitle(),"->",2)==0) {
if (strncmp(dm->GetTitle(),"->",2)==0) {
// We are fine, nothing to do.
if (newClass->IsTObject()) {
newType = kObjectp;
Expand Down

0 comments on commit be1399c

Please sign in to comment.