Skip to content
Snippets Groups Projects
Commit a99a4362 authored by Philippe Canal's avatar Philippe Canal
Browse files

Revert "Trigger the initialization of ClassDefGenerateInitInstanceLocalInjector::fgGenericInfo."

This reverts commit 7c9429e907cfaa329472dbcddddfb5d2324a2f7b.

Due to the fact that a compile ClassDefInline does not
(can not) register a header file, we have a 'new state' where
the TClass might have an initilization routine but can not
have its ClassInfo loaded.  This new state is not yet supported
by the TClass implementation, so we do not yet register the
class with a ClassDefInline in the list of class table
to avoid 'automatic' tool from attempting to use them.
parent 2fac7452
Branches
Tags
No related merge requests found
......@@ -245,11 +245,7 @@ class ClassDefGenerateInitInstanceLocalInjector:
SetInstance(R__instance, &New, &NewArray, &Delete, &DeleteArray, &Destruct);
return &R__instance;
}
// We need a reference to the template instance static member in a concrete function in order
// to force its instantiation (even before the function is actually run)
// Since we do have a reference to Dictionary (in T::Dictionary), using fgGenericInfo
// here will insure that it is initialized at process start or library load time.
static TClass *Dictionary() { fgIsA = fgGenericInfo->GetClass(); return fgIsA; }
static TClass *Dictionary() { fgIsA = GenerateInitInstanceLocal()->GetClass(); return fgIsA; }
static TClass *Class() { SetfgIsA(fgIsA, &Dictionary); return fgIsA; }
static const char* Name() {
if (fgName.empty())
......
......@@ -173,14 +173,26 @@ TEST(HashRecursiveRemove,GetClassClassDefInline)
getcl = TClass::GetClass("WrongSetup");
EXPECT_EQ(getcl,isacl);
EXPECT_NE(nullptr,TClassTable::GetDict("InlineCompiledOnly"));
#if 0
// Due to the fact that a compile ClassDefInline does not
// (can not) register a header file, we have a 'new state' where
// the TClass might have an initilization routine but can not
// have its ClassInfo loaded. This new state is not yet supported
// by the TClass implementation, so we do not yet register the
// class with a ClassDefInline in the list of class table
// to avoid 'automatic' tool from attempting to use them.
//EXPECT_NE(nullptr,TClassTable::GetDict("InlineCompiledOnly"));
//getcl = TClass::GetClass("InlineCompiledOnly");
//EXPECT_NE(nullptr,getcl);
#else
EXPECT_EQ(nullptr,TClassTable::GetDict("InlineCompiledOnly"));
getcl = TClass::GetClass("InlineCompiledOnly");
EXPECT_NE(nullptr,getcl);
// EXPECT_NE(nullptr,TClass::GetClass("InlineCompiledOnly"));
EXPECT_EQ(nullptr,getcl);
#endif
InlineCompiledOnly ico;
isacl = ico.IsA();
EXPECT_NE(nullptr,isacl);
EXPECT_EQ(getcl,isacl);
//EXPECT_EQ(getcl,isacl);
getcl = TClass::GetClass("InlineCompiledOnly");
EXPECT_EQ(getcl,isacl);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment