forked from facebook/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid `error: invalid application of 'sizeof' to an incomplete type '…
…rocksdb:xxx'` when compiling with C++-23 When trying to compile with c++-23 I'm getting errors like: ``` /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'rocksdb::FragmentedRangeTombstoneList' 91 | static_assert(sizeof(_Tp)>0, | ^~~~~~~~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:398:4: note: in instantiation of member function 'std::default_delete<rocksdb::FragmentedRangeTombstoneList>::operator()' requested here 398 | get_deleter()(std::move(__ptr)); | ^ cpp/third-party/rocksdb-cloud/db/range_tombstone_fragmenter.h:25:62: note: in instantiation of member function 'std::unique_ptr<rocksdb::FragmentedRangeTombstoneList>::~unique_ptr' requested here 25 | std::unique_ptr<FragmentedRangeTombstoneList> tombstones = nullptr; | ^ cpp/third-party/rocksdb-cloud/db/range_tombstone_fragmenter.h:20:8: note: forward declaration of 'rocksdb::FragmentedRangeTombstoneList' 20 | struct FragmentedRangeTombstoneList; | ^ ``` With this fix declaration are reargenged to avoid this and when not possible we give explicit constructor/destructors and move them to a different place (ie. not in the headers).
- Loading branch information
1 parent
adb9f1a
commit 674f6ce
Showing
5 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters