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

Latest master branch prepends enum's namespace #274

Closed
rpatters1 opened this issue May 30, 2023 · 11 comments
Closed

Latest master branch prepends enum's namespace #274

rpatters1 opened this issue May 30, 2023 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@rpatters1
Copy link
Contributor

Suppose I have

class foo {
public:
   enum Nums {
      ZERO,
      ONE,
      TWO
   };
};

In versions of magic_enum prior to the latest push (e.g., commit 5367f51), enum_names<foo::Nums> would return:

"ZERO"
"ONE"
"TWO"

It appears that now it returns:

"foo::ZERO"
"foo::ONE"
"foo::TWO"

This breaks my code. (I am using XCode 14.2 on macOS 12.6.5.) If the new behavior is by design, it would be very helpful to have an option to disable it.

@Neargye Neargye added the bug Something isn't working label May 30, 2023
@Neargye Neargye self-assigned this May 30, 2023
@Neargye Neargye modified the milestones: v0.9.1, v0.9.2 May 30, 2023
@Neargye
Copy link
Owner

Neargye commented May 30, 2023

Please retest on master branch, and I will prepare hotfiix release.

@rpatters1
Copy link
Contributor Author

Hello. I will certainly test this when I get back to my dev machine on Thursday or Friday.

@Neargye Neargye closed this as completed May 31, 2023
@Neargye
Copy link
Owner

Neargye commented May 31, 2023

Please reopen if still present.

@rpatters1
Copy link
Contributor Author

It appears to work. If I run into any further issues, I'll let you know.

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2023

Thanks!

@pateldeev
Copy link

I am still seeing issues with enums in an anonymous namespace

https://godbolt.org/z/jTnWE7c5x

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2023

@pateldeev It seems that godbolt does not pull fresh master, becausen locally works for me

https://godbolt.org/z/brWrcfdKq

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2023

Yes, on godbolt trunck = 0.9.0

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2023

In any case, I added new tests to check anonymous namespaces. Thanks

@Neargye
Copy link
Owner

Neargye commented Jun 2, 2023

And test found that problem with enum name in an anonymous namespace on Clang #276

@pateldeev
Copy link

Ah yes. I double checked, and I originally noticed the empty string for clang. Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants