-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fix empty_value
MSVC bug
#175
Fix empty_value
MSVC bug
#175
Conversation
(thank you for working on this. Just a user's comments below)
I think so. As broken as the permission model is in C++ (private things are traps instead of being invisible), there are still some cases where SFINAE can ignore private things, that work with the current code and would be broken with public inheritance.
Again, I think so. It may still be worth it if the bug it works around is worse than what this breaks (I have no idea how to measure that), but if this change is done, in my opinion it should be protected by something like On recent compilers, a simpler implementation of empty_value based on (msvc::)no_unique_address could also be considered. |
This sounds like the best course of action here. |
I'm not sure how far back this problem goes on MSVC. On 16.0, the oldest available version on Compiler Explorer right now, the issue reproduces. That said, how would this be implemented using I can't find any documentation for when |
[[no_unique_address]] works for the same example under Clang and GCC: https://godbolt.org/z/PzqreT8Eb |
Was this bug reported to MSVC devs? If not, please do. As to this PR, I think, this is a better workaround. |
54096b8
to
42b199c
Compare
empty_value
to work around MSVC bugempty_value
MSVC bug
42b199c
to
17a16d6
Compare
🤯 The whole point of NUA is to replace EBO, and MSVC managed to fail... Actually, msvc::no_unique_address is a failure, but there may still be a bit of hope for the real no_unique_address if we complain enough (report 1, report 2) before the next ABI break in MSVC 🤞 |
17a16d6
to
4570d1a
Compare
Thanks. Looks ok to me. |
Great thanks
Got it, here is the bug report. It seems like it's been around for a while, so I'm not holding out hope that it'll get fixed any time soon. But at least we were able to get a workaround |
Please, add a short description and a link to the bug in a comment near
If it's not been reported before, it is likely it wasn't known to the MSVC devs, which is why it wasn't fixed and why it needed to be reported. I don't expect it to be immediately fixed, but it will be, eventually. |
Reminder that we should merge this fix before the Boost 1.86 release window closes. Thank you! |
@glenfe ? |
c5cf950
to
acbeaae
Compare
The following issue has arisen due to a conflict with the new private type alias #include <boost/core/empty_value.hpp>
#include <memory>
struct A : boost::empty_value<std::allocator<void>>
{
};
using base = A;
struct B : base
{
B()
: base{}
{
}
};
|
This can be fixed by renaming |
242b14b broke Boost.Beast again. I can rename the typedefs in Beast, but I guess |
See unordered#257.
Is this a breaking change in Core? It doesn't break any tests, but is it conceptually wrong?