[core] fix compilation with clang-16 and libc++/libstdc++ (#33854)
``` [ 7%] Building CXX object CMakeFiles/grpc_unsecure.dir/src/core/ext/filters/channel_idle/idle_filter_state.cc.o In file included from /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/src/core/ext/filters/census/grpc_context.cc:26: In file included from /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/src/core/lib/debug/trace.h:34: In file included from /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/src/core/lib/gprpp/global_config.h:91: In file included from /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/src/core/lib/gprpp/global_config_env.h:27: In file included from /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/src/core/lib/gprpp/memory.h:24: In file included from /usr/include/c++/v1/memory:898: In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31: /usr/include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application of 'sizeof' to an incomplete type 'grpc_server_config_fetcher' static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); ^~~~~~~~~~~ /usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<grpc_server_config_fetcher>::operator()' requested here __ptr_.second()(__tmp); ^ /usr/include/c++/v1/__memory/unique_ptr.h:231:5: note: in instantiation of member function 'std::unique_ptr<grpc_server_config_fetcher>::reset' requested here reset(__u.release()); ^ /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/src/core/lib/surface/server.h:145:21: note: in instantiation of member function 'std::unique_ptr<grpc_server_config_fetcher>::operator=' requested here config_fetcher_ = std::move(config_fetcher); ^ /home/dpronin/.conan2/p/t/grpc7af12e0c3f76b/b/src/include/grpc/grpc.h:458:16: note: forward declaration of 'grpc_server_config_fetcher' typedef struct grpc_server_config_fetcher grpc_server_config_fetcher; ^ [ 7%] Built target grpc_python_plugin ``` src/core/lib/surface/server.h: Server::set_config_fetcher() function must be defined below the definition of the type 'struct grpc_server_config_fetcher' because std::unique_ptr must know how type looks like at the place where the smart pointer calls a deleter <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. --> --------- Signed-off-by: Denis Pronin <dannftk@yandex.ru> Co-authored-by: Yash Tibrewal <yashkt@google.com>pull/33965/head
parent
fa0312cbf4
commit
e5d7eec584
1 changed files with 10 additions and 5 deletions
Loading…
Reference in new issue