Skip to content

Commit 7d45ab2

Browse files
committed
std::tuple: properly reload ClassInfo and StreamerInfo.
When/if a TClass for a std::tuple is first loaded in forward declared state and then the interpreter information is loaded, we now properly replace the ClassInfo and StreamerInfo
1 parent cf8403b commit 7d45ab2

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

core/metacling/src/TCling.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6663,6 +6663,19 @@ void TCling::RefreshClassInfo(TClass *cl, const clang::NamedDecl *def, bool alia
66636663
}
66646664
} else if (!cl->TestBit(TClass::kLoading) && !cl->fHasRootPcmInfo) {
66656665
cl->ResetCaches();
6666+
if (strncmp(cl->GetName(),"tuple<",strlen("tuple<"))==0) {
6667+
// We need to use the Emulated Tuple but we should not trigger parsing
6668+
// yet, so delay the creation of the ClassInfo
6669+
delete ((TClingClassInfo *)cl->fClassInfo);
6670+
cl->fClassInfo = nullptr;
6671+
cl->fCanLoadClassInfo = true;
6672+
cl->RemoveStreamerInfo(cl->fClassVersion);
6673+
if (cl->fState != TClass::kHasTClassInit) {
6674+
// if (!cl->fClassInfo->IsValid()) cl->fState = TClass::kForwardDeclared; else
6675+
cl->fState = TClass::kInterpreted;
6676+
}
6677+
return;
6678+
}
66666679
// yes, this is almost a waste of time, but we do need to lookup
66676680
// the 'type' corresponding to the TClass anyway in order to
66686681
// preserve the opaque typedefs (Double32_t)

0 commit comments

Comments
 (0)