55a2105258
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/9370 GCC and newer clang, e.g. clang-12 treat `std::unique_ptr` slightly differently. For the following code ``` #include <iostream> #include <memory> #include <type_traits> struct A { std::unique_ptr<int> m1; }; int main() { std::cout << std::boolalpha; std::cout << std::is_standard_layout<A>::value << '\n'; return 0; } ``` GCC11(C++20) (tested on https://en.cppreference.com/w/cpp/types/is_standard_layout) will print "true", while newer clang, e.g. clang-12 will print "false". This breaks the usage of `offsetof()` on structs with non-static members of type `std::unique_ptr`. Fixing this by replacing the builtin `offsetof` with a trick documented at https://gist.github.com/graphitemaster/494f21190bb2c63c5516. Reviewed By: jay-zhuang Differential Revision: D33420840 fbshipit-source-id: 02bde281dfa28809bec787ad0f7019e85dd9c607 |
||
---|---|---|
.. | ||
cf_options.cc | ||
cf_options.h | ||
configurable_helper.h | ||
configurable_test.cc | ||
configurable_test.h | ||
configurable.cc | ||
customizable_test.cc | ||
customizable.cc | ||
db_options.cc | ||
db_options.h | ||
options_helper.cc | ||
options_helper.h | ||
options_parser.cc | ||
options_parser.h | ||
options_settable_test.cc | ||
options_test.cc | ||
options.cc |