Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/meta/src/TDataMember.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,8 @@ void TDataMember::ExtractOptionsFromComment()
//having all options extracted and put into list, we finally can parse
//them to create a list of options...

auto enumDict = IsEnum() ? TEnum::GetEnum(GetTypeName()) : nullptr;

fOptions = new TList(); //create the list

TIter next(optionlist.get()); //we'll iterate through all
Expand Down Expand Up @@ -803,11 +805,10 @@ void TDataMember::ExtractOptionsFromComment()
// We'll try to find global enum existing in ROOT...
l = (Long_t)(*value);
} else if (IsEnum()) {
TObject *obj = fClass->GetListOfDataMembers(false)->FindObject(ptr1);
if (obj)
l = ((TEnumConstant *)obj)->GetValue();
if (auto enumConst = enumDict ? (TEnumConstant*) enumDict->GetConstants()->FindObject(ptr1) : nullptr)
l = enumConst->GetValue();
else
l = gInterpreter->Calc(Form("%s;", ptr1));
l = gInterpreter->Calc(TString::Format("%s;", ptr1));
} else {
Fatal("TDataMember", "Internal error, couldn't recognize enum/global value %s.", ptr1);
}
Expand Down
Loading