Skip to content

Conversation

@liyinsg
Copy link

@liyinsg liyinsg commented Dec 25, 2025

The root cause is unique_ptr has constexpr destructor since C++23

libcxx/include/__memory/unique_ptr.h:75:19: error: invalid application of 'sizeof' to an incomplete type 'brpc::RedisCommandHandler'
75 | static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
| ^~~~~~~~~~~
libcxx/include/__memory/unique_ptr.h:290:7: note: in instantiation of member function 'std::default_deletebrpc::RedisCommandHandler::operator()' requested here
290 | _deleter(__tmp);
| ^
libcxx/include/__memory/unique_ptr.h:259:71: note: in instantiation of member function 'std::unique_ptrbrpc::RedisCommandHandler::reset' requested here
259 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
| ^
src/brpc/redis.h:220:14: note: in instantiation of member function 'std::unique_ptrbrpc::RedisCommandHandler::~unique_ptr' requested here
220 | explicit RedisConnContext(const RedisService* rs)
| ^
src/brpc/redis.h:190:7: note: forward declaration of 'brpc::RedisCommandHandler'
190 | class RedisCommandHandler;

What problem does this PR solve?

Issue Number: resolve

Problem Summary:

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

The root cause is unique_ptr has constexpr destructor since C++23

libcxx/include/__memory/unique_ptr.h:75:19: error: invalid application of 'sizeof' to an incomplete type 'brpc::RedisCommandHandler'
   75 |     static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
      |                   ^~~~~~~~~~~
libcxx/include/__memory/unique_ptr.h:290:7: note: in instantiation of member function 'std::default_delete<brpc::RedisCommandHandler>::operator()' requested here
  290 |       __deleter_(__tmp);
      |       ^
libcxx/include/__memory/unique_ptr.h:259:71: note: in instantiation of member function 'std::unique_ptr<brpc::RedisCommandHandler>::reset' requested here
  259 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
      |                                                                       ^
src/brpc/redis.h:220:14: note: in instantiation of member function 'std::unique_ptr<brpc::RedisCommandHandler>::~unique_ptr' requested here
  220 |     explicit RedisConnContext(const RedisService* rs)
      |              ^
src/brpc/redis.h:190:7: note: forward declaration of 'brpc::RedisCommandHandler'
  190 | class RedisCommandHandler;
@wwbmmm
Copy link
Contributor

wwbmmm commented Dec 26, 2025

LGTM

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