Skip to content

Conversation

@mpatou-openai
Copy link
Collaborator

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).

@mpatou-openai mpatou-openai force-pushed the dev/mpatou/compile_cpp_23 branch from fe44b03 to 6a5f19f Compare January 22, 2025 18:50
@mpatou-openai mpatou-openai requested review from dhruba and tudor January 22, 2025 18:52
@mpatou-openai mpatou-openai marked this pull request as ready for review January 22, 2025 18:53
…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).
@mpatou-openai mpatou-openai force-pushed the dev/mpatou/compile_cpp_23 branch from 6a5f19f to 674f6ce Compare January 22, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants