grpc 1.73.0 → 1.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +38 -17
  3. data/include/grpc/create_channel_from_endpoint.h +54 -0
  4. data/include/grpc/credentials.h +11 -5
  5. data/include/grpc/event_engine/event_engine.h +74 -17
  6. data/include/grpc/grpc_posix.h +20 -1
  7. data/include/grpc/impl/channel_arg_names.h +2 -4
  8. data/include/grpc/module.modulemap +1 -0
  9. data/include/grpc/support/json.h +24 -0
  10. data/src/core/call/interception_chain.h +7 -11
  11. data/src/core/channelz/channel_trace.cc +213 -115
  12. data/src/core/channelz/channel_trace.h +380 -86
  13. data/src/core/channelz/channelz.cc +270 -181
  14. data/src/core/channelz/channelz.h +168 -55
  15. data/src/core/channelz/channelz_registry.cc +2 -1
  16. data/src/core/channelz/channelz_registry.h +24 -0
  17. data/src/core/channelz/property_list.cc +357 -0
  18. data/src/core/channelz/property_list.h +202 -0
  19. data/src/core/channelz/ztrace_collector.h +3 -2
  20. data/src/core/client_channel/backup_poller.cc +17 -2
  21. data/src/core/client_channel/client_channel.cc +17 -28
  22. data/src/core/client_channel/client_channel_filter.cc +19 -29
  23. data/src/core/client_channel/config_selector.h +8 -2
  24. data/src/core/client_channel/dynamic_filters.cc +5 -6
  25. data/src/core/client_channel/dynamic_filters.h +1 -1
  26. data/src/core/client_channel/global_subchannel_pool.cc +4 -1
  27. data/src/core/client_channel/retry_filter.cc +21 -27
  28. data/src/core/client_channel/retry_filter.h +10 -7
  29. data/src/core/client_channel/retry_filter_legacy_call_data.cc +5 -5
  30. data/src/core/client_channel/retry_filter_legacy_call_data.h +1 -1
  31. data/src/core/client_channel/retry_interceptor.cc +30 -44
  32. data/src/core/client_channel/retry_interceptor.h +18 -17
  33. data/src/core/client_channel/retry_throttle.cc +46 -61
  34. data/src/core/client_channel/retry_throttle.h +17 -39
  35. data/src/core/client_channel/subchannel.cc +43 -19
  36. data/src/core/client_channel/subchannel.h +8 -0
  37. data/src/core/config/config_vars.cc +2 -0
  38. data/src/core/config/core_configuration.cc +1 -0
  39. data/src/core/config/core_configuration.h +11 -0
  40. data/src/core/credentials/call/call_creds_registry.h +125 -0
  41. data/src/core/credentials/call/call_creds_registry_init.cc +91 -0
  42. data/src/core/credentials/call/gcp_service_account_identity/gcp_service_account_identity_credentials.cc +6 -48
  43. data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.cc +86 -0
  44. data/src/core/credentials/call/jwt_token_file/jwt_token_file_call_credentials.h +74 -0
  45. data/src/core/credentials/call/jwt_util.cc +70 -0
  46. data/src/core/credentials/call/jwt_util.h +32 -0
  47. data/src/core/credentials/transport/channel_creds_registry_init.cc +1 -1
  48. data/src/core/credentials/transport/google_default/google_default_credentials.cc +72 -4
  49. data/src/core/credentials/transport/ssl/ssl_credentials.cc +0 -1
  50. data/src/core/credentials/transport/tls/load_system_roots_supported.cc +1 -0
  51. data/src/core/credentials/transport/xds/xds_credentials.cc +0 -3
  52. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.cc +8 -8
  53. data/src/core/ext/filters/gcp_authentication/gcp_authentication_filter.h +16 -16
  54. data/src/core/ext/filters/http/client_authority_filter.cc +2 -4
  55. data/src/core/ext/filters/http/message_compress/compression_filter.h +25 -22
  56. data/src/core/ext/filters/http/server/http_server_filter.h +12 -11
  57. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +120 -35
  58. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +6 -5
  59. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +162 -115
  60. data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +0 -3
  61. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +1239 -3514
  62. data/src/core/ext/transport/chttp2/transport/decode_huff.h +1008 -1486
  63. data/src/core/ext/transport/chttp2/transport/flow_control.h +22 -17
  64. data/src/core/ext/transport/chttp2/transport/frame.cc +10 -0
  65. data/src/core/ext/transport/chttp2/transport/frame.h +2 -2
  66. data/src/core/ext/transport/chttp2/transport/frame_data.cc +1 -1
  67. data/src/core/ext/transport/chttp2/transport/frame_settings.cc +7 -8
  68. data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +4 -5
  69. data/src/core/ext/transport/chttp2/transport/header_assembler.h +299 -0
  70. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +1 -1
  71. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +11 -5
  72. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +12 -1
  73. data/src/core/ext/transport/chttp2/transport/http2_client_transport.cc +1017 -0
  74. data/src/core/ext/transport/chttp2/transport/http2_client_transport.h +593 -0
  75. data/src/core/ext/transport/chttp2/transport/http2_settings.h +19 -22
  76. data/{third_party/abseil-cpp/absl/strings/cord_buffer.cc → src/core/ext/transport/chttp2/transport/http2_stats_collector.cc} +14 -14
  77. data/src/core/ext/transport/chttp2/transport/http2_stats_collector.h +33 -0
  78. data/src/core/ext/transport/chttp2/transport/http2_status.h +6 -1
  79. data/src/core/ext/transport/chttp2/transport/http2_transport.cc +43 -0
  80. data/src/core/ext/transport/chttp2/transport/http2_transport.h +65 -0
  81. data/src/core/ext/transport/chttp2/transport/http2_ztrace_collector.h +0 -29
  82. data/src/core/ext/transport/chttp2/transport/internal.h +18 -8
  83. data/src/core/ext/transport/chttp2/transport/keepalive.cc +105 -0
  84. data/src/core/ext/transport/chttp2/transport/keepalive.h +138 -0
  85. data/src/core/ext/transport/chttp2/transport/message_assembler.h +185 -0
  86. data/src/core/ext/transport/chttp2/transport/parsing.cc +2 -4
  87. data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +19 -0
  88. data/src/core/ext/transport/chttp2/transport/ping_promise.cc +151 -0
  89. data/src/core/ext/transport/chttp2/transport/ping_promise.h +180 -0
  90. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +5 -9
  91. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +11 -0
  92. data/src/core/ext/transport/chttp2/transport/stream_lists.cc +39 -1
  93. data/src/core/ext/transport/chttp2/transport/transport_common.cc +19 -0
  94. data/src/core/ext/transport/chttp2/transport/transport_common.h +27 -0
  95. data/src/core/ext/transport/chttp2/transport/writing.cc +37 -11
  96. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb.h +571 -0
  97. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.c +120 -0
  98. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/channelz.upb_minitable.h +36 -0
  99. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb.h +1272 -0
  100. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.c +312 -0
  101. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/promise.upb_minitable.h +50 -0
  102. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb.h +984 -0
  103. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.c +226 -0
  104. data/src/core/ext/upb-gen/src/proto/grpc/channelz/v2/property_list.upb_minitable.h +44 -0
  105. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.c +175 -0
  106. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/promise.upbdefs.h +82 -0
  107. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.c +135 -0
  108. data/src/core/ext/upbdefs-gen/src/proto/grpc/channelz/v2/property_list.upbdefs.h +67 -0
  109. data/src/core/filter/auth/auth_filters.h +0 -25
  110. data/src/core/filter/auth/client_auth_filter.cc +0 -118
  111. data/src/core/filter/filter_args.h +9 -23
  112. data/src/core/handshaker/handshaker.cc +23 -14
  113. data/src/core/handshaker/handshaker.h +3 -0
  114. data/src/core/handshaker/http_connect/http_connect_handshaker.cc +3 -1
  115. data/src/core/handshaker/security/legacy_secure_endpoint.cc +6 -5
  116. data/src/core/handshaker/security/secure_endpoint.cc +70 -25
  117. data/src/core/handshaker/security/security_handshaker.cc +4 -1
  118. data/src/core/handshaker/tcp_connect/tcp_connect_handshaker.cc +7 -1
  119. data/src/core/lib/channel/channel_args.cc +15 -0
  120. data/src/core/lib/channel/channel_args.h +3 -0
  121. data/src/core/lib/channel/channel_stack.cc +22 -23
  122. data/src/core/lib/channel/channel_stack.h +9 -7
  123. data/src/core/lib/channel/channel_stack_builder_impl.cc +1 -1
  124. data/src/core/lib/channel/channel_stack_builder_impl.h +2 -7
  125. data/src/core/lib/channel/promise_based_filter.h +5 -5
  126. data/src/core/lib/debug/trace_impl.h +0 -1
  127. data/src/core/lib/event_engine/ares_resolver.cc +165 -46
  128. data/src/core/lib/event_engine/ares_resolver.h +48 -2
  129. data/src/core/lib/event_engine/cf_engine/cf_engine.cc +3 -1
  130. data/src/core/lib/event_engine/cf_engine/cf_engine.h +1 -4
  131. data/src/core/lib/event_engine/cf_engine/cfstream_endpoint.h +2 -6
  132. data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.cc +40 -0
  133. data/src/core/lib/event_engine/endpoint_channel_arg_wrapper.h +60 -0
  134. data/src/core/lib/event_engine/event_engine.cc +7 -0
  135. data/src/core/lib/event_engine/extensions/channelz.h +10 -6
  136. data/src/core/lib/event_engine/grpc_polled_fd.h +5 -0
  137. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +130 -162
  138. data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +11 -15
  139. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +75 -117
  140. data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +7 -9
  141. data/src/core/lib/event_engine/posix_engine/event_poller.h +18 -15
  142. data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +0 -18
  143. data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.cc +124 -0
  144. data/src/core/lib/event_engine/posix_engine/file_descriptor_collection.h +243 -0
  145. data/src/core/lib/event_engine/posix_engine/grpc_polled_fd_posix.h +29 -19
  146. data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +6 -2
  147. data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +6 -1
  148. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +145 -92
  149. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +9 -19
  150. data/src/core/lib/event_engine/posix_engine/posix_engine.cc +333 -116
  151. data/src/core/lib/event_engine/posix_engine/posix_engine.h +61 -18
  152. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +45 -37
  153. data/src/core/lib/event_engine/posix_engine/posix_engine_listener.h +6 -4
  154. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +32 -142
  155. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.h +6 -5
  156. data/src/core/lib/event_engine/posix_engine/posix_interface.h +211 -0
  157. data/src/core/lib/event_engine/posix_engine/posix_interface_posix.cc +1083 -0
  158. data/src/core/lib/event_engine/posix_engine/posix_interface_windows.cc +281 -0
  159. data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.cc +154 -0
  160. data/src/core/lib/event_engine/posix_engine/posix_write_event_sink.h +174 -0
  161. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +3 -719
  162. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +10 -170
  163. data/src/core/lib/event_engine/posix_engine/timer_manager.cc +33 -22
  164. data/src/core/lib/event_engine/posix_engine/timer_manager.h +13 -11
  165. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +117 -151
  166. data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +26 -94
  167. data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +26 -25
  168. data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +6 -2
  169. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +36 -62
  170. data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +6 -2
  171. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +7 -6
  172. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +12 -6
  173. data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +3 -1
  174. data/src/core/lib/event_engine/shim.cc +9 -0
  175. data/src/core/lib/event_engine/shim.h +3 -0
  176. data/src/core/lib/event_engine/thread_pool/thread_pool.h +7 -3
  177. data/src/core/lib/event_engine/thread_pool/thread_pool_factory.cc +0 -17
  178. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +4 -2
  179. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h +3 -2
  180. data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc +4 -0
  181. data/src/core/lib/event_engine/windows/grpc_polled_fd_windows.h +4 -0
  182. data/src/core/lib/event_engine/windows/windows_endpoint.h +2 -6
  183. data/src/core/lib/event_engine/windows/windows_engine.cc +0 -1
  184. data/src/core/lib/event_engine/windows/windows_engine.h +1 -3
  185. data/src/core/lib/event_engine/windows/windows_listener.cc +14 -2
  186. data/src/core/lib/experiments/experiments.cc +45 -93
  187. data/src/core/lib/experiments/experiments.h +21 -51
  188. data/src/core/lib/iomgr/endpoint.cc +4 -3
  189. data/src/core/lib/iomgr/endpoint.h +7 -4
  190. data/src/core/lib/iomgr/endpoint_cfstream.cc +3 -2
  191. data/src/core/lib/iomgr/ev_epoll1_linux.cc +7 -2
  192. data/src/core/lib/iomgr/ev_poll_posix.cc +7 -2
  193. data/src/core/lib/iomgr/event_engine_shims/endpoint.cc +4 -6
  194. data/src/core/lib/iomgr/tcp_posix.cc +12 -6
  195. data/src/core/lib/iomgr/tcp_windows.cc +3 -2
  196. data/src/core/lib/promise/activity.h +1 -0
  197. data/src/core/lib/promise/arena_promise.h +23 -7
  198. data/src/core/lib/promise/detail/promise_factory.h +10 -0
  199. data/src/core/lib/promise/detail/promise_like.h +118 -11
  200. data/src/core/lib/promise/detail/promise_variant.h +50 -0
  201. data/src/core/lib/promise/detail/seq_state.h +687 -548
  202. data/src/core/lib/promise/if.h +20 -0
  203. data/src/core/lib/promise/inter_activity_latch.h +147 -0
  204. data/src/core/lib/promise/inter_activity_mutex.h +547 -0
  205. data/src/core/lib/promise/loop.h +65 -3
  206. data/src/core/lib/promise/map.h +24 -0
  207. data/src/core/lib/promise/match_promise.h +103 -0
  208. data/src/core/lib/promise/mpsc.cc +425 -0
  209. data/src/core/lib/promise/mpsc.h +490 -0
  210. data/src/core/lib/promise/party.cc +50 -1
  211. data/src/core/lib/promise/party.h +66 -1
  212. data/src/core/lib/promise/race.h +31 -0
  213. data/src/core/lib/promise/seq.h +4 -1
  214. data/src/core/lib/promise/status_flag.h +7 -0
  215. data/src/core/lib/promise/try_seq.h +4 -1
  216. data/src/core/lib/promise/wait_set.cc +28 -0
  217. data/src/core/lib/promise/wait_set.h +86 -0
  218. data/src/core/lib/resource_quota/arena.h +19 -0
  219. data/src/core/lib/slice/slice.h +5 -0
  220. data/src/core/lib/surface/channel_create.cc +88 -13
  221. data/src/core/lib/surface/channel_create.h +4 -0
  222. data/src/core/lib/surface/channel_init.cc +164 -47
  223. data/src/core/lib/surface/channel_init.h +64 -1
  224. data/src/core/lib/surface/filter_stack_call.cc +18 -9
  225. data/src/core/lib/surface/init.cc +6 -15
  226. data/src/core/lib/surface/legacy_channel.cc +3 -5
  227. data/src/core/lib/surface/legacy_channel.h +3 -1
  228. data/src/core/lib/surface/version.cc +2 -2
  229. data/src/core/lib/transport/promise_endpoint.cc +110 -0
  230. data/src/core/lib/transport/promise_endpoint.h +307 -0
  231. data/src/core/load_balancing/child_policy_handler.cc +2 -4
  232. data/src/core/load_balancing/delegating_helper.h +2 -3
  233. data/src/core/load_balancing/health_check_client.cc +1 -5
  234. data/src/core/load_balancing/lb_policy.h +1 -3
  235. data/src/core/load_balancing/oob_backend_metric.cc +1 -5
  236. data/src/core/load_balancing/pick_first/pick_first.cc +3 -0
  237. data/src/core/load_balancing/xds/cds.cc +10 -1
  238. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -0
  239. data/src/core/resolver/xds/xds_config.cc +6 -3
  240. data/src/core/resolver/xds/xds_config.h +9 -4
  241. data/src/core/resolver/xds/xds_dependency_manager.cc +21 -6
  242. data/src/core/resolver/xds/xds_dependency_manager.h +2 -1
  243. data/src/core/resolver/xds/xds_resolver.cc +31 -11
  244. data/src/core/server/server.cc +83 -12
  245. data/src/core/server/server.h +21 -2
  246. data/src/core/server/xds_server_config_fetcher.cc +63 -25
  247. data/src/core/service_config/service_config.h +1 -1
  248. data/src/core/service_config/service_config_impl.h +1 -1
  249. data/src/core/telemetry/context_list_entry.cc +38 -0
  250. data/src/core/telemetry/context_list_entry.h +42 -12
  251. data/src/core/telemetry/stats_data.cc +233 -207
  252. data/src/core/telemetry/stats_data.h +250 -153
  253. data/src/core/telemetry/tcp_tracer.h +1 -1
  254. data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +11 -3
  255. data/src/core/tsi/fake_transport_security.cc +17 -0
  256. data/src/core/tsi/ssl_transport_security.cc +2 -0
  257. data/src/core/tsi/transport_security_grpc.cc +8 -0
  258. data/src/core/tsi/transport_security_grpc.h +15 -0
  259. data/src/core/util/backoff.cc +1 -5
  260. data/src/core/util/backoff.h +1 -0
  261. data/src/core/util/down_cast.h +1 -1
  262. data/src/core/util/function_signature.h +15 -1
  263. data/src/core/util/http_client/httpcli.cc +12 -5
  264. data/src/core/util/http_client/httpcli.h +4 -1
  265. data/src/core/util/latent_see.h +8 -5
  266. data/src/core/util/log.cc +4 -0
  267. data/src/core/util/memory_usage.h +268 -0
  268. data/src/core/util/per_cpu.cc +2 -0
  269. data/src/core/util/per_cpu.h +7 -0
  270. data/src/core/util/shared_bit_gen.h +20 -0
  271. data/src/core/util/single_set_ptr.h +2 -2
  272. data/src/core/util/upb_utils.h +42 -0
  273. data/src/core/util/uri.cc +3 -2
  274. data/src/core/util/useful.h +53 -2
  275. data/src/core/util/wait_for_single_owner.cc +31 -0
  276. data/src/core/util/wait_for_single_owner.h +24 -0
  277. data/src/core/xds/grpc/xds_bootstrap_grpc.cc +2 -0
  278. data/src/core/xds/grpc/xds_bootstrap_grpc.h +5 -0
  279. data/src/core/xds/grpc/xds_client_grpc.cc +6 -2
  280. data/src/core/xds/grpc/xds_common_types_parser.cc +138 -50
  281. data/src/core/xds/grpc/xds_common_types_parser.h +12 -0
  282. data/src/core/xds/grpc/xds_http_filter.h +7 -0
  283. data/src/core/xds/grpc/xds_http_gcp_authn_filter.cc +22 -0
  284. data/src/core/xds/grpc/xds_http_gcp_authn_filter.h +3 -0
  285. data/src/core/xds/grpc/xds_route_config_parser.cc +15 -38
  286. data/src/core/xds/grpc/xds_server_grpc.cc +63 -13
  287. data/src/core/xds/grpc/xds_server_grpc.h +10 -2
  288. data/src/core/xds/grpc/xds_server_grpc_interface.h +4 -0
  289. data/src/core/xds/grpc/xds_transport_grpc.cc +18 -0
  290. data/src/core/xds/xds_client/xds_bootstrap.h +2 -0
  291. data/src/core/xds/xds_client/xds_client.cc +26 -5
  292. data/src/ruby/ext/grpc/extconf.rb +2 -0
  293. data/src/ruby/ext/grpc/rb_call.c +1 -8
  294. data/src/ruby/ext/grpc/rb_channel.c +72 -568
  295. data/src/ruby/ext/grpc/rb_channel.h +0 -3
  296. data/src/ruby/ext/grpc/rb_completion_queue.c +26 -14
  297. data/src/ruby/ext/grpc/rb_completion_queue.h +1 -7
  298. data/src/ruby/ext/grpc/rb_grpc.c +9 -5
  299. data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
  300. data/src/ruby/ext/grpc/rb_loader.c +0 -4
  301. data/src/ruby/ext/grpc/rb_server.c +31 -50
  302. data/src/ruby/lib/grpc/generic/client_stub.rb +4 -4
  303. data/src/ruby/lib/grpc/version.rb +1 -1
  304. data/src/ruby/spec/core_spec.rb +22 -0
  305. data/src/ruby/spec/generic/active_call_spec.rb +1 -1
  306. data/third_party/abseil-cpp/absl/algorithm/container.h +2 -19
  307. data/third_party/abseil-cpp/absl/base/attributes.h +76 -7
  308. data/third_party/abseil-cpp/absl/base/call_once.h +11 -12
  309. data/third_party/abseil-cpp/absl/base/config.h +20 -129
  310. data/third_party/abseil-cpp/absl/base/{internal/fast_type_id.h → fast_type_id.h} +11 -16
  311. data/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +0 -5
  312. data/third_party/abseil-cpp/absl/base/internal/cycleclock_config.h +7 -7
  313. data/third_party/abseil-cpp/absl/base/internal/endian.h +34 -38
  314. data/third_party/abseil-cpp/absl/base/internal/iterator_traits.h +71 -0
  315. data/third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -5
  316. data/third_party/abseil-cpp/absl/base/internal/{nullability_impl.h → nullability_deprecated.h} +45 -8
  317. data/third_party/abseil-cpp/absl/base/internal/spinlock.cc +0 -9
  318. data/third_party/abseil-cpp/absl/base/internal/spinlock.h +3 -13
  319. data/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +6 -6
  320. data/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +8 -3
  321. data/third_party/abseil-cpp/absl/base/no_destructor.h +11 -32
  322. data/third_party/abseil-cpp/absl/base/nullability.h +84 -72
  323. data/third_party/abseil-cpp/absl/base/options.h +3 -80
  324. data/third_party/abseil-cpp/absl/base/policy_checks.h +7 -7
  325. data/third_party/abseil-cpp/absl/cleanup/cleanup.h +1 -3
  326. data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -4
  327. data/third_party/abseil-cpp/absl/container/btree_map.h +4 -2
  328. data/third_party/abseil-cpp/absl/container/btree_set.h +4 -2
  329. data/third_party/abseil-cpp/absl/container/fixed_array.h +7 -14
  330. data/third_party/abseil-cpp/absl/container/flat_hash_map.h +5 -0
  331. data/third_party/abseil-cpp/absl/container/flat_hash_set.h +6 -1
  332. data/third_party/abseil-cpp/absl/container/inlined_vector.h +8 -5
  333. data/third_party/abseil-cpp/absl/container/internal/btree.h +132 -29
  334. data/third_party/abseil-cpp/absl/container/internal/btree_container.h +175 -71
  335. data/third_party/abseil-cpp/absl/container/internal/common.h +43 -0
  336. data/third_party/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -2
  337. data/third_party/abseil-cpp/absl/container/internal/container_memory.h +9 -10
  338. data/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +1 -8
  339. data/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +0 -4
  340. data/third_party/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +527 -0
  341. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +20 -4
  342. data/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +31 -12
  343. data/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +2 -7
  344. data/third_party/abseil-cpp/absl/container/internal/layout.h +26 -42
  345. data/third_party/abseil-cpp/absl/container/internal/raw_hash_map.h +199 -68
  346. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +1354 -183
  347. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +881 -1424
  348. data/third_party/abseil-cpp/absl/container/internal/raw_hash_set_resize_impl.h +80 -0
  349. data/third_party/abseil-cpp/absl/crc/crc32c.cc +0 -4
  350. data/third_party/abseil-cpp/absl/crc/crc32c.h +7 -5
  351. data/third_party/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +0 -22
  352. data/third_party/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +45 -74
  353. data/third_party/abseil-cpp/absl/debugging/internal/addresses.h +57 -0
  354. data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.cc +1 -1
  355. data/third_party/abseil-cpp/absl/debugging/internal/decode_rust_punycode.h +5 -5
  356. data/third_party/abseil-cpp/absl/debugging/internal/demangle.cc +8 -35
  357. data/third_party/abseil-cpp/absl/debugging/internal/demangle_rust.cc +16 -16
  358. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +40 -37
  359. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_arm-inl.inc +16 -7
  360. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +14 -5
  361. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +10 -4
  362. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc +27 -16
  363. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +13 -4
  364. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_unimplemented-inl.inc +4 -3
  365. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_win32-inl.inc +15 -28
  366. data/third_party/abseil-cpp/absl/debugging/internal/stacktrace_x86-inl.inc +19 -9
  367. data/third_party/abseil-cpp/absl/debugging/stacktrace.cc +144 -27
  368. data/third_party/abseil-cpp/absl/debugging/stacktrace.h +73 -5
  369. data/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +19 -9
  370. data/third_party/abseil-cpp/absl/debugging/symbolize_emscripten.inc +3 -2
  371. data/third_party/abseil-cpp/absl/debugging/symbolize_win32.inc +25 -6
  372. data/third_party/abseil-cpp/absl/flags/commandlineflag.h +2 -2
  373. data/third_party/abseil-cpp/absl/flags/flag.h +4 -3
  374. data/third_party/abseil-cpp/absl/flags/internal/commandlineflag.h +2 -2
  375. data/third_party/abseil-cpp/absl/flags/internal/flag.cc +2 -1
  376. data/third_party/abseil-cpp/absl/flags/internal/flag.h +7 -6
  377. data/third_party/abseil-cpp/absl/flags/internal/registry.h +4 -3
  378. data/third_party/abseil-cpp/absl/flags/reflection.cc +2 -3
  379. data/third_party/abseil-cpp/absl/functional/any_invocable.h +8 -10
  380. data/third_party/abseil-cpp/absl/functional/function_ref.h +2 -9
  381. data/third_party/abseil-cpp/absl/functional/internal/any_invocable.h +110 -226
  382. data/third_party/abseil-cpp/absl/functional/internal/front_binder.h +10 -12
  383. data/third_party/abseil-cpp/absl/functional/internal/function_ref.h +2 -5
  384. data/third_party/abseil-cpp/absl/hash/hash.h +18 -0
  385. data/third_party/abseil-cpp/absl/hash/internal/hash.cc +1 -5
  386. data/third_party/abseil-cpp/absl/hash/internal/hash.h +86 -61
  387. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.cc +25 -68
  388. data/third_party/abseil-cpp/absl/hash/internal/low_level_hash.h +2 -6
  389. data/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h +38 -0
  390. data/third_party/abseil-cpp/absl/log/check.h +2 -1
  391. data/third_party/abseil-cpp/absl/log/globals.h +4 -5
  392. data/third_party/abseil-cpp/absl/log/internal/append_truncated.h +28 -0
  393. data/third_party/abseil-cpp/absl/log/internal/check_op.cc +22 -22
  394. data/third_party/abseil-cpp/absl/log/internal/check_op.h +65 -62
  395. data/third_party/abseil-cpp/absl/log/internal/conditions.cc +5 -3
  396. data/third_party/abseil-cpp/absl/log/internal/conditions.h +7 -2
  397. data/third_party/abseil-cpp/absl/log/internal/log_message.cc +85 -43
  398. data/third_party/abseil-cpp/absl/log/internal/log_message.h +84 -59
  399. data/third_party/abseil-cpp/absl/log/internal/nullstream.h +1 -0
  400. data/third_party/abseil-cpp/absl/log/internal/proto.cc +3 -2
  401. data/third_party/abseil-cpp/absl/log/internal/proto.h +3 -3
  402. data/third_party/abseil-cpp/absl/log/internal/strip.h +4 -12
  403. data/third_party/abseil-cpp/absl/log/internal/vlog_config.h +8 -6
  404. data/third_party/abseil-cpp/absl/log/internal/voidify.h +10 -4
  405. data/third_party/abseil-cpp/absl/log/log.h +48 -35
  406. data/third_party/abseil-cpp/absl/log/log_sink_registry.h +2 -2
  407. data/third_party/abseil-cpp/absl/meta/type_traits.h +46 -175
  408. data/third_party/abseil-cpp/absl/numeric/bits.h +68 -2
  409. data/third_party/abseil-cpp/absl/numeric/int128.cc +0 -52
  410. data/third_party/abseil-cpp/absl/numeric/internal/bits.h +7 -3
  411. data/third_party/abseil-cpp/absl/profiling/internal/exponential_biased.cc +1 -1
  412. data/third_party/abseil-cpp/absl/random/bit_gen_ref.h +10 -11
  413. data/third_party/abseil-cpp/absl/random/distributions.h +6 -8
  414. data/third_party/abseil-cpp/absl/random/gaussian_distribution.h +1 -1
  415. data/third_party/abseil-cpp/absl/random/internal/distribution_caller.h +5 -6
  416. data/third_party/abseil-cpp/absl/random/internal/{pool_urbg.cc → entropy_pool.cc} +22 -90
  417. data/third_party/abseil-cpp/absl/random/internal/entropy_pool.h +35 -0
  418. data/third_party/abseil-cpp/absl/random/internal/nonsecure_base.h +5 -6
  419. data/third_party/abseil-cpp/absl/random/internal/randen_detect.cc +1 -1
  420. data/third_party/abseil-cpp/absl/random/internal/seed_material.cc +20 -12
  421. data/third_party/abseil-cpp/absl/random/internal/seed_material.h +5 -5
  422. data/third_party/abseil-cpp/absl/random/random.h +88 -53
  423. data/third_party/abseil-cpp/absl/random/seed_sequences.cc +6 -2
  424. data/third_party/abseil-cpp/absl/status/internal/status_internal.cc +3 -4
  425. data/third_party/abseil-cpp/absl/status/internal/status_internal.h +3 -4
  426. data/third_party/abseil-cpp/absl/status/internal/statusor_internal.h +4 -3
  427. data/third_party/abseil-cpp/absl/status/status.cc +4 -8
  428. data/third_party/abseil-cpp/absl/status/status.h +8 -8
  429. data/third_party/abseil-cpp/absl/status/status_payload_printer.h +2 -2
  430. data/third_party/abseil-cpp/absl/status/statusor.cc +2 -2
  431. data/third_party/abseil-cpp/absl/status/statusor.h +6 -6
  432. data/third_party/abseil-cpp/absl/strings/ascii.cc +9 -9
  433. data/third_party/abseil-cpp/absl/strings/ascii.h +18 -18
  434. data/third_party/abseil-cpp/absl/strings/charconv.cc +21 -22
  435. data/third_party/abseil-cpp/absl/strings/charconv.h +5 -5
  436. data/third_party/abseil-cpp/absl/strings/cord.cc +54 -58
  437. data/third_party/abseil-cpp/absl/strings/cord.h +94 -83
  438. data/third_party/abseil-cpp/absl/strings/cord_analysis.cc +11 -11
  439. data/third_party/abseil-cpp/absl/strings/cord_analysis.h +3 -3
  440. data/third_party/abseil-cpp/absl/strings/escaping.cc +130 -149
  441. data/third_party/abseil-cpp/absl/strings/escaping.h +9 -10
  442. data/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc +1 -1
  443. data/third_party/abseil-cpp/absl/strings/internal/cord_internal.h +6 -8
  444. data/third_party/abseil-cpp/absl/strings/internal/cord_rep_btree.cc +0 -4
  445. data/third_party/abseil-cpp/absl/strings/internal/cordz_info.cc +0 -4
  446. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc +7 -63
  447. data/third_party/abseil-cpp/absl/strings/internal/str_format/arg.h +1 -11
  448. data/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc +0 -22
  449. data/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc +5 -3
  450. data/third_party/abseil-cpp/absl/strings/internal/str_format/parser.h +4 -2
  451. data/third_party/abseil-cpp/absl/strings/internal/str_join_internal.h +3 -3
  452. data/third_party/abseil-cpp/absl/strings/internal/string_constant.h +0 -5
  453. data/third_party/abseil-cpp/absl/strings/internal/utf8.cc +96 -1
  454. data/third_party/abseil-cpp/absl/strings/internal/utf8.h +15 -1
  455. data/third_party/abseil-cpp/absl/strings/numbers.cc +53 -32
  456. data/third_party/abseil-cpp/absl/strings/numbers.h +87 -58
  457. data/third_party/abseil-cpp/absl/strings/str_cat.cc +6 -7
  458. data/third_party/abseil-cpp/absl/strings/str_cat.h +32 -32
  459. data/third_party/abseil-cpp/absl/strings/str_format.h +18 -18
  460. data/third_party/abseil-cpp/absl/strings/str_replace.cc +3 -3
  461. data/third_party/abseil-cpp/absl/strings/str_replace.h +6 -6
  462. data/third_party/abseil-cpp/absl/strings/string_view.cc +4 -9
  463. data/third_party/abseil-cpp/absl/strings/string_view.h +27 -32
  464. data/third_party/abseil-cpp/absl/strings/strip.h +4 -4
  465. data/third_party/abseil-cpp/absl/strings/substitute.cc +5 -4
  466. data/third_party/abseil-cpp/absl/strings/substitute.h +66 -64
  467. data/third_party/abseil-cpp/absl/synchronization/internal/futex_waiter.cc +0 -4
  468. data/third_party/abseil-cpp/absl/synchronization/internal/kernel_timeout.cc +0 -5
  469. data/third_party/abseil-cpp/absl/synchronization/internal/pthread_waiter.cc +0 -4
  470. data/third_party/abseil-cpp/absl/synchronization/internal/sem_waiter.cc +0 -4
  471. data/third_party/abseil-cpp/absl/synchronization/internal/stdcpp_waiter.cc +0 -4
  472. data/third_party/abseil-cpp/absl/synchronization/internal/waiter_base.cc +0 -4
  473. data/third_party/abseil-cpp/absl/synchronization/internal/win32_waiter.cc +0 -4
  474. data/third_party/abseil-cpp/absl/synchronization/mutex.cc +1 -1
  475. data/third_party/abseil-cpp/absl/synchronization/mutex.h +97 -69
  476. data/third_party/abseil-cpp/absl/synchronization/notification.h +1 -1
  477. data/third_party/abseil-cpp/absl/time/civil_time.cc +1 -0
  478. data/third_party/abseil-cpp/absl/time/duration.cc +12 -7
  479. data/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +1 -1
  480. data/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup.cc +90 -111
  481. data/third_party/abseil-cpp/absl/time/time.h +20 -15
  482. data/third_party/abseil-cpp/absl/types/optional.h +7 -747
  483. data/third_party/abseil-cpp/absl/types/span.h +13 -11
  484. data/third_party/abseil-cpp/absl/types/variant.h +5 -784
  485. data/third_party/abseil-cpp/absl/utility/utility.h +10 -185
  486. metadata +72 -20
  487. data/src/core/lib/event_engine/forkable.cc +0 -105
  488. data/src/core/lib/event_engine/forkable.h +0 -67
  489. data/src/core/lib/iomgr/python_util.h +0 -46
  490. data/third_party/abseil-cpp/absl/base/internal/inline_variable.h +0 -108
  491. data/third_party/abseil-cpp/absl/base/internal/invoke.h +0 -241
  492. data/third_party/abseil-cpp/absl/log/log_entry.cc +0 -41
  493. data/third_party/abseil-cpp/absl/random/internal/pool_urbg.h +0 -131
  494. data/third_party/abseil-cpp/absl/types/bad_optional_access.cc +0 -66
  495. data/third_party/abseil-cpp/absl/types/bad_optional_access.h +0 -78
  496. data/third_party/abseil-cpp/absl/types/bad_variant_access.cc +0 -82
  497. data/third_party/abseil-cpp/absl/types/bad_variant_access.h +0 -82
  498. data/third_party/abseil-cpp/absl/types/internal/optional.h +0 -352
  499. data/third_party/abseil-cpp/absl/types/internal/variant.h +0 -1622
@@ -19,6 +19,7 @@
19
19
  #include <functional>
20
20
 
21
21
  #include "absl/base/config.h"
22
+ #include "absl/base/fast_type_id.h"
22
23
  #include "absl/flags/commandlineflag.h"
23
24
  #include "absl/flags/internal/commandlineflag.h"
24
25
  #include "absl/strings/string_view.h"
@@ -73,7 +74,7 @@ void FinalizeRegistry();
73
74
  //
74
75
 
75
76
  // Retire flag with name "name" and type indicated by ops.
76
- void Retire(const char* name, FlagFastTypeId type_id, char* buf);
77
+ void Retire(const char* name, FlagFastTypeId type_id, unsigned char* buf);
77
78
 
78
79
  constexpr size_t kRetiredFlagObjSize = 3 * sizeof(void*);
79
80
  constexpr size_t kRetiredFlagObjAlignment = alignof(void*);
@@ -83,11 +84,11 @@ template <typename T>
83
84
  class RetiredFlag {
84
85
  public:
85
86
  void Retire(const char* flag_name) {
86
- flags_internal::Retire(flag_name, base_internal::FastTypeId<T>(), buf_);
87
+ flags_internal::Retire(flag_name, absl::FastTypeId<T>(), buf_);
87
88
  }
88
89
 
89
90
  private:
90
- alignas(kRetiredFlagObjAlignment) char buf_[kRetiredFlagObjSize];
91
+ alignas(kRetiredFlagObjAlignment) unsigned char buf_[kRetiredFlagObjSize];
91
92
  };
92
93
 
93
94
  } // namespace flags_internal
@@ -289,11 +289,10 @@ class RetiredFlagObj final : public CommandLineFlag {
289
289
 
290
290
  } // namespace
291
291
 
292
- void Retire(const char* name, FlagFastTypeId type_id, char* buf) {
292
+ void Retire(const char* name, FlagFastTypeId type_id, unsigned char* buf) {
293
293
  static_assert(sizeof(RetiredFlagObj) == kRetiredFlagObjSize, "");
294
294
  static_assert(alignof(RetiredFlagObj) == kRetiredFlagObjAlignment, "");
295
- auto* flag = ::new (static_cast<void*>(buf))
296
- flags_internal::RetiredFlagObj(name, type_id);
295
+ auto* flag = ::new (buf) flags_internal::RetiredFlagObj(name, type_id);
297
296
  FlagRegistry::GlobalRegistry().RegisterFlag(*flag, nullptr);
298
297
  }
299
298
 
@@ -25,7 +25,7 @@
25
25
  //
26
26
  // NOTE: `absl::AnyInvocable` is similar to the C++23 `std::move_only_function`
27
27
  // abstraction, but has a slightly different API and is not designed to be a
28
- // drop-in replacement or C++11-compatible backfill of that type.
28
+ // drop-in replacement or backfill of that type.
29
29
  //
30
30
  // Credits to Matt Calabrese (https://github.com/mattcalabrese) for the original
31
31
  // implementation.
@@ -97,11 +97,10 @@ ABSL_NAMESPACE_BEGIN
97
97
  // my_func(std::move(func6));
98
98
  //
99
99
  // `AnyInvocable` also properly respects `const` qualifiers, reference
100
- // qualifiers, and the `noexcept` specification (only in C++ 17 and beyond) as
101
- // part of the user-specified function type (e.g.
102
- // `AnyInvocable<void() const && noexcept>`). These qualifiers will be applied
103
- // to the `AnyInvocable` object's `operator()`, and the underlying invocable
104
- // must be compatible with those qualifiers.
100
+ // qualifiers, and the `noexcept` specification as part of the user-specified
101
+ // function type (e.g. `AnyInvocable<void() const && noexcept>`). These
102
+ // qualifiers will be applied to the `AnyInvocable` object's `operator()`, and
103
+ // the underlying invocable must be compatible with those qualifiers.
105
104
  //
106
105
  // Comparison of const and non-const function types:
107
106
  //
@@ -280,11 +279,10 @@ class AnyInvocable : private internal_any_invocable::Impl<Sig> {
280
279
  //
281
280
  // WARNING: An `AnyInvocable` that wraps an empty `std::function` is not
282
281
  // itself empty. This behavior is consistent with the standard equivalent
283
- // `std::move_only_function`.
284
- //
285
- // In other words:
282
+ // `std::move_only_function`. In the following example, `a()` will actually
283
+ // invoke `f()`, leading to an `std::bad_function_call` exception:
286
284
  // std::function<void()> f; // empty
287
- // absl::AnyInvocable<void()> a = std::move(f); // not empty
285
+ // absl::AnyInvocable<void()> a = f; // not empty
288
286
  //
289
287
  // Invoking an empty `AnyInvocable` results in undefined behavior.
290
288
  explicit operator bool() const noexcept { return this->HasValue(); }
@@ -82,17 +82,12 @@ class FunctionRef;
82
82
  // // replaced by an `absl::FunctionRef`:
83
83
  // bool Visitor(absl::FunctionRef<void(my_proto&, absl::string_view)>
84
84
  // callback);
85
- //
86
- // Note: the assignment operator within an `absl::FunctionRef` is intentionally
87
- // deleted to prevent misuse; because the `absl::FunctionRef` does not own the
88
- // underlying type, assignment likely indicates misuse.
89
85
  template <typename R, typename... Args>
90
86
  class FunctionRef<R(Args...)> {
91
87
  private:
92
88
  // Used to disable constructors for objects that are not compatible with the
93
89
  // signature of this FunctionRef.
94
- template <typename F,
95
- typename FR = absl::base_internal::invoke_result_t<F, Args&&...>>
90
+ template <typename F, typename FR = std::invoke_result_t<F, Args&&...>>
96
91
  using EnableIfCompatible =
97
92
  typename std::enable_if<std::is_void<R>::value ||
98
93
  std::is_convertible<FR, R>::value>::type;
@@ -122,9 +117,7 @@ class FunctionRef<R(Args...)> {
122
117
  ptr_.fun = reinterpret_cast<decltype(ptr_.fun)>(f);
123
118
  }
124
119
 
125
- // To help prevent subtle lifetime bugs, FunctionRef is not assignable.
126
- // Typically, it should only be used as an argument type.
127
- FunctionRef& operator=(const FunctionRef& rhs) = delete;
120
+ FunctionRef& operator=(const FunctionRef& rhs) = default;
128
121
  FunctionRef(const FunctionRef& rhs) = default;
129
122
 
130
123
  // Call the underlying object.
@@ -65,7 +65,6 @@
65
65
 
66
66
  #include "absl/base/attributes.h"
67
67
  #include "absl/base/config.h"
68
- #include "absl/base/internal/invoke.h"
69
68
  #include "absl/base/macros.h"
70
69
  #include "absl/base/optimization.h"
71
70
  #include "absl/meta/type_traits.h"
@@ -74,15 +73,6 @@
74
73
  namespace absl {
75
74
  ABSL_NAMESPACE_BEGIN
76
75
 
77
- // Helper macro used to prevent spelling `noexcept` in language versions older
78
- // than C++17, where it is not part of the type system, in order to avoid
79
- // compilation failures and internal compiler errors.
80
- #if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
81
- #define ABSL_INTERNAL_NOEXCEPT_SPEC(noex) noexcept(noex)
82
- #else
83
- #define ABSL_INTERNAL_NOEXCEPT_SPEC(noex)
84
- #endif
85
-
86
76
  // Defined in functional/any_invocable.h
87
77
  template <class Sig>
88
78
  class AnyInvocable;
@@ -107,44 +97,30 @@ struct IsAnyInvocable<AnyInvocable<Sig>> : std::true_type {};
107
97
  //
108
98
  ////////////////////////////////////////////////////////////////////////////////
109
99
 
110
- // A type trait that tells us whether or not a target function type should be
100
+ // A metafunction that tells us whether or not a target function type should be
111
101
  // stored locally in the small object optimization storage
112
102
  template <class T>
113
- using IsStoredLocally = std::integral_constant<
114
- bool, sizeof(T) <= kStorageSize && alignof(T) <= kAlignment &&
115
- kAlignment % alignof(T) == 0 &&
116
- std::is_nothrow_move_constructible<T>::value>;
103
+ constexpr bool IsStoredLocally() {
104
+ if constexpr (sizeof(T) <= kStorageSize && alignof(T) <= kAlignment &&
105
+ kAlignment % alignof(T) == 0) {
106
+ return std::is_nothrow_move_constructible<T>::value;
107
+ }
108
+ return false;
109
+ }
117
110
 
118
111
  // An implementation of std::remove_cvref_t of C++20.
119
112
  template <class T>
120
113
  using RemoveCVRef =
121
114
  typename std::remove_cv<typename std::remove_reference<T>::type>::type;
122
115
 
123
- ////////////////////////////////////////////////////////////////////////////////
124
- //
125
- // An implementation of the C++ standard INVOKE<R> pseudo-macro, operation is
126
- // equivalent to std::invoke except that it forces an implicit conversion to the
127
- // specified return type. If "R" is void, the function is executed and the
128
- // return value is simply ignored.
129
- template <class ReturnType, class F, class... P,
130
- typename = absl::enable_if_t<std::is_void<ReturnType>::value>>
131
- void InvokeR(F&& f, P&&... args) {
132
- absl::base_internal::invoke(std::forward<F>(f), std::forward<P>(args)...);
133
- }
134
-
135
- template <class ReturnType, class F, class... P,
136
- absl::enable_if_t<!std::is_void<ReturnType>::value, int> = 0>
116
+ // An implementation of std::invoke_r of C++23.
117
+ template <class ReturnType, class F, class... P>
137
118
  ReturnType InvokeR(F&& f, P&&... args) {
138
- // GCC 12 has a false-positive -Wmaybe-uninitialized warning here.
139
- #if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
140
- #pragma GCC diagnostic push
141
- #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
142
- #endif
143
- return absl::base_internal::invoke(std::forward<F>(f),
144
- std::forward<P>(args)...);
145
- #if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
146
- #pragma GCC diagnostic pop
147
- #endif
119
+ if constexpr (std::is_void_v<ReturnType>) {
120
+ std::invoke(std::forward<F>(f), std::forward<P>(args)...);
121
+ } else {
122
+ return std::invoke(std::forward<F>(f), std::forward<P>(args)...);
123
+ }
148
124
  }
149
125
 
150
126
  //
@@ -198,32 +174,14 @@ union TypeErasedState {
198
174
  } remote;
199
175
 
200
176
  // Local-storage for the type-erased object when small and trivial enough
201
- alignas(kAlignment) char storage[kStorageSize];
177
+ alignas(kAlignment) unsigned char storage[kStorageSize];
202
178
  };
203
179
 
204
180
  // A typed accessor for the object in `TypeErasedState` storage
205
181
  template <class T>
206
182
  T& ObjectInLocalStorage(TypeErasedState* const state) {
207
183
  // We launder here because the storage may be reused with the same type.
208
- #if defined(__cpp_lib_launder) && __cpp_lib_launder >= 201606L
209
184
  return *std::launder(reinterpret_cast<T*>(&state->storage));
210
- #elif ABSL_HAVE_BUILTIN(__builtin_launder)
211
- return *__builtin_launder(reinterpret_cast<T*>(&state->storage));
212
- #else
213
-
214
- // When `std::launder` or equivalent are not available, we rely on undefined
215
- // behavior, which works as intended on Abseil's officially supported
216
- // platforms as of Q2 2022.
217
- #if !defined(__clang__) && defined(__GNUC__)
218
- #pragma GCC diagnostic push
219
- #pragma GCC diagnostic ignored "-Wstrict-aliasing"
220
- #endif
221
- return *reinterpret_cast<T*>(&state->storage);
222
- #if !defined(__clang__) && defined(__GNUC__)
223
- #pragma GCC diagnostic pop
224
- #endif
225
-
226
- #endif
227
185
  }
228
186
 
229
187
  // The type for functions issuing lifetime-related operations: move and dispose
@@ -231,14 +189,14 @@ T& ObjectInLocalStorage(TypeErasedState* const state) {
231
189
  // NOTE: When specifying `FunctionToCall::`dispose, the same state must be
232
190
  // passed as both "from" and "to".
233
191
  using ManagerType = void(FunctionToCall /*operation*/,
234
- TypeErasedState* /*from*/, TypeErasedState* /*to*/)
235
- ABSL_INTERNAL_NOEXCEPT_SPEC(true);
192
+ TypeErasedState* /*from*/,
193
+ TypeErasedState* /*to*/) noexcept(true);
236
194
 
237
195
  // The type for functions issuing the actual invocation of the object
238
196
  // A pointer to such a function is contained in each AnyInvocable instance.
239
197
  template <bool SigIsNoexcept, class ReturnType, class... P>
240
- using InvokerType = ReturnType(TypeErasedState*, ForwardedParameterType<P>...)
241
- ABSL_INTERNAL_NOEXCEPT_SPEC(SigIsNoexcept);
198
+ using InvokerType = ReturnType(
199
+ TypeErasedState*, ForwardedParameterType<P>...) noexcept(SigIsNoexcept);
242
200
 
243
201
  // The manager that is used when AnyInvocable is empty
244
202
  inline void EmptyManager(FunctionToCall /*operation*/,
@@ -275,7 +233,7 @@ template <class T>
275
233
  void LocalManagerNontrivial(FunctionToCall operation,
276
234
  TypeErasedState* const from,
277
235
  TypeErasedState* const to) noexcept {
278
- static_assert(IsStoredLocally<T>::value,
236
+ static_assert(IsStoredLocally<T>(),
279
237
  "Local storage must only be used for supported types.");
280
238
  static_assert(!std::is_trivially_copyable<T>::value,
281
239
  "Locally stored types must be trivially copyable.");
@@ -303,7 +261,7 @@ ReturnType LocalInvoker(
303
261
  ForwardedParameterType<P>... args) noexcept(SigIsNoexcept) {
304
262
  using RawT = RemoveCVRef<QualTRef>;
305
263
  static_assert(
306
- IsStoredLocally<RawT>::value,
264
+ IsStoredLocally<RawT>(),
307
265
  "Target object must be in local storage in order to be invoked from it.");
308
266
 
309
267
  auto& f = (ObjectInLocalStorage<RawT>)(state);
@@ -338,7 +296,7 @@ template <class T>
338
296
  void RemoteManagerNontrivial(FunctionToCall operation,
339
297
  TypeErasedState* const from,
340
298
  TypeErasedState* const to) noexcept {
341
- static_assert(!IsStoredLocally<T>::value,
299
+ static_assert(!IsStoredLocally<T>(),
342
300
  "Remote storage must only be used for types that do not "
343
301
  "qualify for local storage.");
344
302
 
@@ -360,7 +318,7 @@ ReturnType RemoteInvoker(
360
318
  TypeErasedState* const state,
361
319
  ForwardedParameterType<P>... args) noexcept(SigIsNoexcept) {
362
320
  using RawT = RemoveCVRef<QualTRef>;
363
- static_assert(!IsStoredLocally<RawT>::value,
321
+ static_assert(!IsStoredLocally<RawT>(),
364
322
  "Target object must be in remote storage in order to be "
365
323
  "invoked from it.");
366
324
 
@@ -440,13 +398,6 @@ class CoreImpl {
440
398
 
441
399
  CoreImpl() noexcept : manager_(EmptyManager), invoker_(nullptr) {}
442
400
 
443
- enum class TargetType {
444
- kPointer,
445
- kCompatibleAnyInvocable,
446
- kIncompatibleAnyInvocable,
447
- kOther,
448
- };
449
-
450
401
  // Note: QualDecayedTRef here includes the cv-ref qualifiers associated with
451
402
  // the invocation of the Invocable. The unqualified type is the target object
452
403
  // type to be stored.
@@ -454,19 +405,47 @@ class CoreImpl {
454
405
  explicit CoreImpl(TypedConversionConstruct<QualDecayedTRef>, F&& f) {
455
406
  using DecayedT = RemoveCVRef<QualDecayedTRef>;
456
407
 
457
- constexpr TargetType kTargetType =
458
- (std::is_pointer<DecayedT>::value ||
459
- std::is_member_pointer<DecayedT>::value)
460
- ? TargetType::kPointer
461
- : IsCompatibleAnyInvocable<DecayedT>::value
462
- ? TargetType::kCompatibleAnyInvocable
463
- : IsAnyInvocable<DecayedT>::value
464
- ? TargetType::kIncompatibleAnyInvocable
465
- : TargetType::kOther;
466
- // NOTE: We only use integers instead of enums as template parameters in
467
- // order to work around a bug on C++14 under MSVC 2017.
468
- // See b/236131881.
469
- Initialize<kTargetType, QualDecayedTRef>(std::forward<F>(f));
408
+ if constexpr (std::is_pointer<DecayedT>::value ||
409
+ std::is_member_pointer<DecayedT>::value) {
410
+ // This condition handles types that decay into pointers. This includes
411
+ // function references, which cannot be null. GCC warns against comparing
412
+ // their decayed form with nullptr (https://godbolt.org/z/9r9TMTcPK).
413
+ // We could work around this warning with constexpr programming, using
414
+ // std::is_function_v<std::remove_reference_t<F>>, but we choose to ignore
415
+ // it instead of writing more code.
416
+ #if !defined(__clang__) && defined(__GNUC__)
417
+ #pragma GCC diagnostic push
418
+ #pragma GCC diagnostic ignored "-Wpragmas"
419
+ #pragma GCC diagnostic ignored "-Waddress"
420
+ #pragma GCC diagnostic ignored "-Wnonnull-compare"
421
+ #endif
422
+ if (static_cast<DecayedT>(f) == nullptr) {
423
+ #if !defined(__clang__) && defined(__GNUC__)
424
+ #pragma GCC diagnostic pop
425
+ #endif
426
+ manager_ = EmptyManager;
427
+ invoker_ = nullptr;
428
+ } else {
429
+ InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
430
+ }
431
+ } else if constexpr (IsCompatibleAnyInvocable<DecayedT>::value) {
432
+ // In this case we can "steal the guts" of the other AnyInvocable.
433
+ f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
434
+ manager_ = f.manager_;
435
+ invoker_ = f.invoker_;
436
+
437
+ f.manager_ = EmptyManager;
438
+ f.invoker_ = nullptr;
439
+ } else if constexpr (IsAnyInvocable<DecayedT>::value) {
440
+ if (f.HasValue()) {
441
+ InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
442
+ } else {
443
+ manager_ = EmptyManager;
444
+ invoker_ = nullptr;
445
+ }
446
+ } else {
447
+ InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
448
+ }
470
449
  }
471
450
 
472
451
  // Note: QualTRef here includes the cv-ref qualifiers associated with the
@@ -517,122 +496,43 @@ class CoreImpl {
517
496
  invoker_ = nullptr;
518
497
  }
519
498
 
520
- template <TargetType target_type, class QualDecayedTRef, class F,
521
- absl::enable_if_t<target_type == TargetType::kPointer, int> = 0>
522
- void Initialize(F&& f) {
523
- // This condition handles types that decay into pointers, which includes
524
- // function references. Since function references cannot be null, GCC warns
525
- // against comparing their decayed form with nullptr.
526
- // Since this is template-heavy code, we prefer to disable these warnings
527
- // locally instead of adding yet another overload of this function.
528
- #if !defined(__clang__) && defined(__GNUC__)
529
- #pragma GCC diagnostic push
530
- #pragma GCC diagnostic ignored "-Wpragmas"
531
- #pragma GCC diagnostic ignored "-Waddress"
532
- #pragma GCC diagnostic ignored "-Wnonnull-compare"
533
- #endif
534
- if (static_cast<RemoveCVRef<QualDecayedTRef>>(f) == nullptr) {
535
- #if !defined(__clang__) && defined(__GNUC__)
536
- #pragma GCC diagnostic pop
537
- #endif
538
- manager_ = EmptyManager;
539
- invoker_ = nullptr;
540
- return;
541
- }
542
- InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
543
- }
544
-
545
- template <TargetType target_type, class QualDecayedTRef, class F,
546
- absl::enable_if_t<
547
- target_type == TargetType::kCompatibleAnyInvocable, int> = 0>
548
- void Initialize(F&& f) {
549
- // In this case we can "steal the guts" of the other AnyInvocable.
550
- f.manager_(FunctionToCall::relocate_from_to, &f.state_, &state_);
551
- manager_ = f.manager_;
552
- invoker_ = f.invoker_;
553
-
554
- f.manager_ = EmptyManager;
555
- f.invoker_ = nullptr;
556
- }
557
-
558
- template <TargetType target_type, class QualDecayedTRef, class F,
559
- absl::enable_if_t<
560
- target_type == TargetType::kIncompatibleAnyInvocable, int> = 0>
561
- void Initialize(F&& f) {
562
- if (f.HasValue()) {
563
- InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
564
- } else {
565
- manager_ = EmptyManager;
566
- invoker_ = nullptr;
567
- }
568
- }
569
-
570
- template <TargetType target_type, class QualDecayedTRef, class F,
571
- typename = absl::enable_if_t<target_type == TargetType::kOther>>
572
- void Initialize(F&& f) {
573
- InitializeStorage<QualDecayedTRef>(std::forward<F>(f));
574
- }
575
-
576
499
  // Use local (inline) storage for applicable target object types.
577
- template <class QualTRef, class... Args,
578
- typename = absl::enable_if_t<
579
- IsStoredLocally<RemoveCVRef<QualTRef>>::value>>
500
+ template <class QualTRef, class... Args>
580
501
  void InitializeStorage(Args&&... args) {
581
502
  using RawT = RemoveCVRef<QualTRef>;
582
- ::new (static_cast<void*>(&state_.storage))
583
- RawT(std::forward<Args>(args)...);
584
-
585
- invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
586
- // We can simplify our manager if we know the type is trivially copyable.
587
- InitializeLocalManager<RawT>();
588
- }
589
-
590
- // Use remote storage for target objects that cannot be stored locally.
591
- template <class QualTRef, class... Args,
592
- absl::enable_if_t<!IsStoredLocally<RemoveCVRef<QualTRef>>::value,
593
- int> = 0>
594
- void InitializeStorage(Args&&... args) {
595
- InitializeRemoteManager<RemoveCVRef<QualTRef>>(std::forward<Args>(args)...);
596
- // This is set after everything else in case an exception is thrown in an
597
- // earlier step of the initialization.
598
- invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
599
- }
600
-
601
- template <class T,
602
- typename = absl::enable_if_t<std::is_trivially_copyable<T>::value>>
603
- void InitializeLocalManager() {
604
- manager_ = LocalManagerTrivial;
605
- }
606
-
607
- template <class T,
608
- absl::enable_if_t<!std::is_trivially_copyable<T>::value, int> = 0>
609
- void InitializeLocalManager() {
610
- manager_ = LocalManagerNontrivial<T>;
611
- }
612
-
613
- template <class T>
614
- using HasTrivialRemoteStorage =
615
- std::integral_constant<bool, std::is_trivially_destructible<T>::value &&
616
- alignof(T) <=
617
- ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT>;
618
-
619
- template <class T, class... Args,
620
- typename = absl::enable_if_t<HasTrivialRemoteStorage<T>::value>>
621
- void InitializeRemoteManager(Args&&... args) {
622
- // unique_ptr is used for exception-safety in case construction throws.
623
- std::unique_ptr<void, TrivialDeleter> uninitialized_target(
624
- ::operator new(sizeof(T)), TrivialDeleter(sizeof(T)));
625
- ::new (uninitialized_target.get()) T(std::forward<Args>(args)...);
626
- state_.remote.target = uninitialized_target.release();
627
- state_.remote.size = sizeof(T);
628
- manager_ = RemoteManagerTrivial;
503
+ if constexpr (IsStoredLocally<RawT>()) {
504
+ ::new (static_cast<void*>(&state_.storage))
505
+ RawT(std::forward<Args>(args)...);
506
+ invoker_ = LocalInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
507
+ // We can simplify our manager if we know the type is trivially copyable.
508
+ if constexpr (std::is_trivially_copyable_v<RawT>) {
509
+ manager_ = LocalManagerTrivial;
510
+ } else {
511
+ manager_ = LocalManagerNontrivial<RawT>;
512
+ }
513
+ } else {
514
+ InitializeRemoteManager<RawT>(std::forward<Args>(args)...);
515
+ // This is set after everything else in case an exception is thrown in an
516
+ // earlier step of the initialization.
517
+ invoker_ = RemoteInvoker<SigIsNoexcept, ReturnType, QualTRef, P...>;
518
+ }
629
519
  }
630
520
 
631
- template <class T, class... Args,
632
- absl::enable_if_t<!HasTrivialRemoteStorage<T>::value, int> = 0>
521
+ template <class T, class... Args>
633
522
  void InitializeRemoteManager(Args&&... args) {
634
- state_.remote.target = ::new T(std::forward<Args>(args)...);
635
- manager_ = RemoteManagerNontrivial<T>;
523
+ if constexpr (std::is_trivially_destructible_v<T> &&
524
+ alignof(T) <= ABSL_INTERNAL_DEFAULT_NEW_ALIGNMENT) {
525
+ // unique_ptr is used for exception-safety in case construction throws.
526
+ std::unique_ptr<void, TrivialDeleter> uninitialized_target(
527
+ ::operator new(sizeof(T)), TrivialDeleter(sizeof(T)));
528
+ ::new (uninitialized_target.get()) T(std::forward<Args>(args)...);
529
+ state_.remote.target = uninitialized_target.release();
530
+ state_.remote.size = sizeof(T);
531
+ manager_ = RemoteManagerTrivial;
532
+ } else {
533
+ state_.remote.target = ::new T(std::forward<Args>(args)...);
534
+ manager_ = RemoteManagerNontrivial<T>;
535
+ }
636
536
  }
637
537
 
638
538
  //////////////////////////////////////////////////////////////////////////////
@@ -734,17 +634,12 @@ using CanAssignReferenceWrapper = TrueAlias<
734
634
  absl::enable_if_t<Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<
735
635
  std::reference_wrapper<F>>::value>>;
736
636
 
737
- ////////////////////////////////////////////////////////////////////////////////
738
- //
739
637
  // The constraint for checking whether or not a call meets the noexcept
740
- // callability requirements. This is a preprocessor macro because specifying it
638
+ // callability requirements. We use a preprocessor macro because specifying it
741
639
  // this way as opposed to a disjunction/branch can improve the user-side error
742
640
  // messages and avoids an instantiation of std::is_nothrow_invocable_r in the
743
641
  // cases where the user did not specify a noexcept function type.
744
642
  //
745
- #define ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT(inv_quals, noex) \
746
- ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_##noex(inv_quals)
747
-
748
643
  // The disjunction below is because we can't rely on std::is_nothrow_invocable_r
749
644
  // to give the right result when ReturnType is non-moveable in toolchains that
750
645
  // don't treat non-moveable result types correctly. For example this was the
@@ -759,7 +654,7 @@ using CanAssignReferenceWrapper = TrueAlias<
759
654
  UnwrapStdReferenceWrapper<absl::decay_t<F>> inv_quals, P...>, \
760
655
  std::is_same< \
761
656
  ReturnType, \
762
- absl::base_internal::invoke_result_t< \
657
+ std::invoke_result_t< \
763
658
  UnwrapStdReferenceWrapper<absl::decay_t<F>> inv_quals, \
764
659
  P...>>>>::value>
765
660
 
@@ -775,13 +670,13 @@ using CanAssignReferenceWrapper = TrueAlias<
775
670
  // noex is "true" if the function type is noexcept, or false if it is not.
776
671
  //
777
672
  // The CallIsValid condition is more complicated than simply using
778
- // absl::base_internal::is_invocable_r because we can't rely on it to give the
779
- // right result when ReturnType is non-moveable in toolchains that don't treat
780
- // non-moveable result types correctly. For example this was the case in libc++
781
- // before commit c3a24882 (2022-05).
673
+ // std::is_invocable_r because we can't rely on it to give the right result
674
+ // when ReturnType is non-moveable in toolchains that don't treat non-moveable
675
+ // result types correctly. For example this was the case in libc++ before commit
676
+ // c3a24882 (2022-05).
782
677
  #define ABSL_INTERNAL_ANY_INVOCABLE_IMPL_(cv, ref, inv_quals, noex) \
783
678
  template <class ReturnType, class... P> \
784
- class Impl<ReturnType(P...) cv ref ABSL_INTERNAL_NOEXCEPT_SPEC(noex)> \
679
+ class Impl<ReturnType(P...) cv ref noexcept(noex)> \
785
680
  : public CoreImpl<noex, ReturnType, P...> { \
786
681
  public: \
787
682
  /*The base class, which contains the datamembers and core operations*/ \
@@ -790,17 +685,16 @@ using CanAssignReferenceWrapper = TrueAlias<
790
685
  /*SFINAE constraint to check if F is invocable with the proper signature*/ \
791
686
  template <class F> \
792
687
  using CallIsValid = TrueAlias<absl::enable_if_t<absl::disjunction< \
793
- absl::base_internal::is_invocable_r<ReturnType, \
794
- absl::decay_t<F> inv_quals, P...>, \
795
- std::is_same<ReturnType, \
796
- absl::base_internal::invoke_result_t< \
797
- absl::decay_t<F> inv_quals, P...>>>::value>>; \
688
+ std::is_invocable_r<ReturnType, absl::decay_t<F> inv_quals, P...>, \
689
+ std::is_same< \
690
+ ReturnType, \
691
+ std::invoke_result_t<absl::decay_t<F> inv_quals, P...>>>::value>>; \
798
692
  \
799
693
  /*SFINAE constraint to check if F is nothrow-invocable when necessary*/ \
800
694
  template <class F> \
801
695
  using CallIsNoexceptIfSigIsNoexcept = \
802
- TrueAlias<ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT(inv_quals, \
803
- noex)>; \
696
+ TrueAlias<ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_##noex( \
697
+ inv_quals)>; \
804
698
  \
805
699
  /*Put the AnyInvocable into an empty state.*/ \
806
700
  Impl() = default; \
@@ -822,8 +716,7 @@ using CanAssignReferenceWrapper = TrueAlias<
822
716
  \
823
717
  /*Raises a fatal error when the AnyInvocable is invoked after a move*/ \
824
718
  static ReturnType InvokedAfterMove( \
825
- TypeErasedState*, \
826
- ForwardedParameterType<P>...) noexcept(noex) { \
719
+ TypeErasedState*, ForwardedParameterType<P>...) noexcept(noex) { \
827
720
  ABSL_HARDENING_ASSERT(false && "AnyInvocable use-after-move"); \
828
721
  std::terminate(); \
829
722
  } \
@@ -851,18 +744,11 @@ using CanAssignReferenceWrapper = TrueAlias<
851
744
  } \
852
745
  }
853
746
 
854
- // Define the `noexcept(true)` specialization only for C++17 and beyond, when
855
- // `noexcept` is part of the type system.
856
- #if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L
857
747
  // A convenience macro that defines specializations for the noexcept(true) and
858
748
  // noexcept(false) forms, given the other properties.
859
749
  #define ABSL_INTERNAL_ANY_INVOCABLE_IMPL(cv, ref, inv_quals) \
860
750
  ABSL_INTERNAL_ANY_INVOCABLE_IMPL_(cv, ref, inv_quals, false); \
861
751
  ABSL_INTERNAL_ANY_INVOCABLE_IMPL_(cv, ref, inv_quals, true)
862
- #else
863
- #define ABSL_INTERNAL_ANY_INVOCABLE_IMPL(cv, ref, inv_quals) \
864
- ABSL_INTERNAL_ANY_INVOCABLE_IMPL_(cv, ref, inv_quals, false)
865
- #endif
866
752
 
867
753
  // Non-ref-qualified partial specializations
868
754
  ABSL_INTERNAL_ANY_INVOCABLE_IMPL(, , &);
@@ -881,8 +767,6 @@ ABSL_INTERNAL_ANY_INVOCABLE_IMPL(const, &&, const&&);
881
767
  #undef ABSL_INTERNAL_ANY_INVOCABLE_IMPL_
882
768
  #undef ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_false
883
769
  #undef ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_true
884
- #undef ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT
885
- #undef ABSL_INTERNAL_NOEXCEPT_SPEC
886
770
 
887
771
  } // namespace internal_any_invocable
888
772
  ABSL_NAMESPACE_END