-
Notifications
You must be signed in to change notification settings - Fork 111
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
Using nameof_member on structures with non-constexpr destructor fails to compile on MSVC #49
Comments
Hi @kamchatka-volcano ! So If Foo's destructor is constexpr, then it will work. I Investigate any other solution for not constexpr destructor, but I think this is an MSVC compiler or C++std bug. It must not to call members user-defined destructor in the union, but the constexpr-ness property is inherited somewhy, based on the compiler error note: |
I see, that's what I was afraid of) In my project |
Hi, I think I've found a working solution by using I opened a PR (#50), please check it out) |
Hi, I finally got around to updating nameof in my project to test the fix of #46 by @schaumb.
Unfortunately, it doesn't work when
TestStruct
has a member with a non-constexpr user-provided constructor. Is it possible to fix it?I looked into the source, but I don't understand the union trick used in the
member_name_v
implementation for MSVC, so I can't tell if it can be fixed.As previously, the following code doesn't compile on MSVC (2022) using the latest master of
nameof
, but works fine with clang and gccThe text was updated successfully, but these errors were encountered: