Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEnum::GetEnum does NOT process typedefs #12685

Closed
pcanal opened this issue Apr 19, 2023 · 3 comments · Fixed by #15408
Closed

TEnum::GetEnum does NOT process typedefs #12685

pcanal opened this issue Apr 19, 2023 · 3 comments · Fixed by #15408

Comments

@pcanal
Copy link
Member

pcanal commented Apr 19, 2023

Currently if the parameter to TEnum::GetEnums ends in a typedef/alias, it can not find the enums.
With the example:

enum EFruit {kApple=78, kBanana=29, kCitrus=34};
// std::vector<EFruit> vec;
using EFruit_t = EFruit;

void repro()
{
    auto type = "std::vector<EFruit>::value_type";
    cout << gInterpreter->ClassInfo_IsEnum(type) << endl;
    cout << TEnum::GetEnum(type) << endl;
    auto resolved = TClassEdit::ResolveTypedef (type, kTRUE);
    cout << TEnum::GetEnum(resolved.c_str()) << endl;
    cout << TEnum::GetEnum("EFruit_t") << endl;
}

We get:

1
0
0x267f2a0
0

Where the two '0' indicates that the lookup failed.

This is seen in #10454 and holds up (per se) #11412

@pcanal pcanal added the bug label Apr 19, 2023
@pcanal pcanal changed the title TEnum::GetEnum does process typedefs TEnum::GetEnum does NOT process typedefs Apr 19, 2023
@jblomer
Copy link
Contributor

jblomer commented Jul 11, 2023

The problem extends to the specification of the underlying integer type, e.g.

enum A : int {};
TEnum::GetEnum("A")->GetUnderlyingType()  // --> (EDataType) (kInt_t) : (int) 3

but

enum B : std::int32_t {};
TEnum::GetEnum("B")->GetUnderlyingType()  // --> (EDataType) (kNumDataTypes) : (int) 23

Do you want to keep it as part of this issue or should I open a new one?

@pcanal
Copy link
Member Author

pcanal commented Jul 12, 2023

This should be enough.

@pcanal
Copy link
Member Author

pcanal commented May 8, 2024

We need to open a new issue for #12685 (comment)
it is: #15460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants