-
Notifications
You must be signed in to change notification settings - Fork 41
Fix C++23 compilation errors in leveldb #47
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
Conversation
Remove usages of std::aligned_storage, which is deprecated. More details about the replacement in https://crbug.com/388068052. PiperOrigin-RevId: 713346733
cl/713346733 changed the type of some variables to pointers, but didn't adjust the placement new statements. From pkasting@: "I suspect your code is wrong and will crash. An array is a pointer, so taking its address also gives a pointer, which is why it compiles; but the value of that pointer is different. You're no longer providing the address of the storage, but rather the address of the array pointer." PiperOrigin-RevId: 717926210
FYI the upstream PR landed |
Chromium has also re-rolled to the current upstream: https://issues.chromium.org/issues/388068052#comment10. |
Undraft then? |
utACK 183e79a |
ACK 183e79a. I don't think the second commit actually changes anything. |
4188247086 Merge bitcoin-core/leveldb-subtree#47: Fix C++23 compilation errors in leveldb 183e79a495 Fix speculatively some "placement new" issues in leveldb 82c31046ed Fix C++23 compilation errors in leveldb git-subtree-dir: src/leveldb git-subtree-split: 41882470862df219f74cdd38354007b91eb98191
Why? |
I tried it in godbolt, and both versions produce the same machine code (but also, my understanding of how arrays work in C++ is that there is no distinction). |
4188247086 Merge bitcoin-core/leveldb-subtree#47: Fix C++23 compilation errors in leveldb 183e79a495 Fix speculatively some "placement new" issues in leveldb 82c31046ed Fix C++23 compilation errors in leveldb git-subtree-dir: src/leveldb git-subtree-split: 41882470862df219f74cdd38354007b91eb98191
4188247086 Merge bitcoin-core/leveldb-subtree#47: Fix C++23 compilation errors in leveldb 183e79a495 Fix speculatively some "placement new" issues in leveldb 82c31046ed Fix C++23 compilation errors in leveldb git-subtree-dir: src/leveldb git-subtree-split: 41882470862df219f74cdd38354007b91eb98191
4188247086 Merge bitcoin-core/leveldb-subtree#47: Fix C++23 compilation errors in leveldb 183e79a495 Fix speculatively some "placement new" issues in leveldb 82c31046ed Fix C++23 compilation errors in leveldb git-subtree-dir: src/leveldb git-subtree-split: 41882470862df219f74cdd38354007b91eb98191
Cherry-picks two commits from upstream (google@302786e, google@e829478), which remove the usage of
std::aligned_storage/std::aligned_union
.Note the first cherry-pick is not clean, because due to Google tooling issues, it accidently contained a revert of the prior two commits. See google#1249 for more details, as well as https://issues.chromium.org/issues/388068052.
Closes #43.