From be1399cc87900735ba48dfd3e9b62f0ba413184a Mon Sep 17 00:00:00 2001 From: Philippe Canal Date: Tue, 13 Nov 2018 13:52:02 -0600 Subject: [PATCH] In BuildOld, don't make all unique_ptr as having -> in comment. 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 : 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. --- io/io/src/TStreamerInfo.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/io/io/src/TStreamerInfo.cxx b/io/io/src/TStreamerInfo.cxx index 1020cb51219b0..ead253b947fe2 100644 --- a/io/io/src/TStreamerInfo.cxx +++ b/io/io/src/TStreamerInfo.cxx @@ -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 maxIndices; // 5 is the maximum supported in TStreamerElement::SetMaxIndex @@ -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 @@ -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;