diff --git a/core/meta/src/TEnum.cxx b/core/meta/src/TEnum.cxx index 7095f51bce0b50..a06de6fbcd37f5 100644 --- a/core/meta/src/TEnum.cxx +++ b/core/meta/src/TEnum.cxx @@ -277,10 +277,21 @@ TEnum *TEnum::GetEnum(const char *enumName, ESearchAction sa) return nullptr; } - // Keep the state consistent. I particular prevent change in the state of AutoLoading and AutoParsing allowance - // and gROOT->GetListOfClasses() and the later update/modification to the autoparsing state. + // Keep the state consistent. In particular prevent change in the state of + // AutoLoading and AutoParsing allowance and gROOT->GetListOfClasses() + // and the later update/modification to the autoparsing state. R__READ_LOCKGUARD(ROOT::gCoreMutex); + std::string normalizedName; + { + TInterpreter::SuspendAutoLoadingRAII autoloadOff(gInterpreter); + TClassEdit::GetNormalizedName(normalizedName, enumName); + } + if (normalizedName != enumName) { + enumName = normalizedName.c_str(); + lastPos = TClassEdit::GetUnqualifiedName(enumName); + } + if (lastPos != enumName) { // We have a scope // All of this C gymnastic is to avoid allocations on the heap (see TClingLookupHelper__ExistingTypeCheck)