re2 1.24.0 → 1.25.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 (370) hide show
  1. package/LICENSE +15 -20
  2. package/README.md +63 -4
  3. package/binding.gyp +1 -2
  4. package/lib/addon.cc +9 -5
  5. package/lib/exec.cc +4 -4
  6. package/lib/match.cc +4 -4
  7. package/lib/new.cc +6 -6
  8. package/lib/pattern.cc +148 -1
  9. package/lib/replace.cc +5 -4
  10. package/lib/search.cc +1 -1
  11. package/lib/set.cc +85 -10
  12. package/lib/test.cc +1 -1
  13. package/lib/unicode_properties.h +15840 -0
  14. package/lib/wrapped_re2.h +40 -4
  15. package/lib/wrapped_re2_set.h +3 -1
  16. package/llms-full.txt +497 -0
  17. package/llms.txt +135 -0
  18. package/package.json +19 -11
  19. package/re2.d.ts +2 -0
  20. package/re2.js +1 -0
  21. package/vendor/abseil-cpp/CMake/AbseilDll.cmake +87 -74
  22. package/vendor/abseil-cpp/CMakeLists.txt +3 -3
  23. package/vendor/abseil-cpp/FAQ.md +130 -79
  24. package/vendor/abseil-cpp/MODULE.bazel +6 -7
  25. package/vendor/abseil-cpp/absl/BUILD.bazel +6 -0
  26. package/vendor/abseil-cpp/absl/algorithm/BUILD.bazel +4 -0
  27. package/vendor/abseil-cpp/absl/algorithm/CMakeLists.txt +4 -0
  28. package/vendor/abseil-cpp/absl/algorithm/algorithm.h +34 -2
  29. package/vendor/abseil-cpp/absl/algorithm/container.h +164 -17
  30. package/vendor/abseil-cpp/absl/algorithm/container_test.cc +390 -13
  31. package/vendor/abseil-cpp/absl/base/BUILD.bazel +53 -6
  32. package/vendor/abseil-cpp/absl/base/CMakeLists.txt +28 -4
  33. package/vendor/abseil-cpp/absl/base/attributes.h +61 -42
  34. package/vendor/abseil-cpp/absl/base/call_once.h +1 -0
  35. package/vendor/abseil-cpp/absl/base/casts.h +8 -1
  36. package/vendor/abseil-cpp/absl/base/casts_test.cc +3 -6
  37. package/vendor/abseil-cpp/absl/base/config.h +53 -9
  38. package/vendor/abseil-cpp/absl/base/exception_safety_testing_test.cc +9 -9
  39. package/vendor/abseil-cpp/absl/base/fast_type_id.h +30 -2
  40. package/vendor/abseil-cpp/absl/base/fast_type_id_test.cc +3 -0
  41. package/vendor/abseil-cpp/absl/base/internal/exception_safety_testing.h +15 -12
  42. package/vendor/abseil-cpp/absl/base/internal/hardening.h +136 -0
  43. package/vendor/abseil-cpp/absl/base/internal/hardening_test.cc +168 -0
  44. package/vendor/abseil-cpp/absl/base/internal/iterator_traits.h +2 -2
  45. package/vendor/abseil-cpp/absl/base/internal/low_level_alloc.cc +6 -0
  46. package/vendor/abseil-cpp/absl/base/internal/low_level_scheduling.h +77 -15
  47. package/vendor/abseil-cpp/absl/base/internal/sysinfo.cc +1 -2
  48. package/vendor/abseil-cpp/absl/base/internal/thread_identity.h +52 -0
  49. package/vendor/abseil-cpp/absl/base/internal/unscaledcycleclock.h +5 -0
  50. package/vendor/abseil-cpp/absl/base/macros.h +36 -20
  51. package/vendor/abseil-cpp/absl/base/nullability.h +4 -3
  52. package/vendor/abseil-cpp/absl/base/optimization.h +3 -2
  53. package/vendor/abseil-cpp/absl/base/optimization_test.cc +4 -3
  54. package/vendor/abseil-cpp/absl/base/options.h +55 -1
  55. package/vendor/abseil-cpp/absl/base/policy_checks.h +5 -5
  56. package/vendor/abseil-cpp/absl/base/{internal/throw_delegate.cc → throw_delegate.cc} +9 -7
  57. package/vendor/abseil-cpp/absl/base/{internal/throw_delegate.h → throw_delegate.h} +4 -14
  58. package/vendor/abseil-cpp/absl/base/throw_delegate_test.cc +19 -28
  59. package/vendor/abseil-cpp/absl/cleanup/BUILD.bazel +2 -0
  60. package/vendor/abseil-cpp/absl/cleanup/CMakeLists.txt +2 -0
  61. package/vendor/abseil-cpp/absl/cleanup/cleanup.h +3 -2
  62. package/vendor/abseil-cpp/absl/cleanup/internal/cleanup.h +3 -2
  63. package/vendor/abseil-cpp/absl/container/BUILD.bazel +19 -7
  64. package/vendor/abseil-cpp/absl/container/CMakeLists.txt +6 -5
  65. package/vendor/abseil-cpp/absl/container/btree_benchmark.cc +3 -5
  66. package/vendor/abseil-cpp/absl/container/btree_set.h +5 -5
  67. package/vendor/abseil-cpp/absl/container/btree_test.cc +11 -14
  68. package/vendor/abseil-cpp/absl/container/chunked_queue.h +8 -6
  69. package/vendor/abseil-cpp/absl/container/chunked_queue_test.cc +5 -5
  70. package/vendor/abseil-cpp/absl/container/fixed_array.h +14 -13
  71. package/vendor/abseil-cpp/absl/container/fixed_array_test.cc +3 -3
  72. package/vendor/abseil-cpp/absl/container/flat_hash_map.h +18 -6
  73. package/vendor/abseil-cpp/absl/container/flat_hash_map_test.cc +34 -1
  74. package/vendor/abseil-cpp/absl/container/flat_hash_set.h +21 -7
  75. package/vendor/abseil-cpp/absl/container/flat_hash_set_test.cc +39 -7
  76. package/vendor/abseil-cpp/absl/container/inlined_vector.h +29 -29
  77. package/vendor/abseil-cpp/absl/container/inlined_vector_test.cc +2 -2
  78. package/vendor/abseil-cpp/absl/container/internal/btree.h +32 -24
  79. package/vendor/abseil-cpp/absl/container/internal/btree_container.h +16 -17
  80. package/vendor/abseil-cpp/absl/container/internal/common.h +6 -5
  81. package/vendor/abseil-cpp/absl/container/internal/common_policy_traits.h +1 -1
  82. package/vendor/abseil-cpp/absl/container/internal/compressed_tuple.h +16 -16
  83. package/vendor/abseil-cpp/absl/container/internal/compressed_tuple_test.cc +13 -13
  84. package/vendor/abseil-cpp/absl/container/internal/container_memory.h +41 -31
  85. package/vendor/abseil-cpp/absl/container/internal/hash_function_defaults.h +2 -2
  86. package/vendor/abseil-cpp/absl/container/internal/hash_generator_testing.h +4 -4
  87. package/vendor/abseil-cpp/absl/container/internal/hash_policy_traits.h +3 -3
  88. package/vendor/abseil-cpp/absl/container/internal/hashtable_control_bytes.h +27 -19
  89. package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +2 -2
  90. package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler.h +0 -17
  91. package/vendor/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc +12 -30
  92. package/vendor/abseil-cpp/absl/container/internal/inlined_vector.h +28 -28
  93. package/vendor/abseil-cpp/absl/container/internal/layout.h +13 -13
  94. package/vendor/abseil-cpp/absl/container/internal/layout_test.cc +3 -2
  95. package/vendor/abseil-cpp/absl/container/internal/raw_hash_map.h +60 -62
  96. package/vendor/abseil-cpp/absl/container/internal/raw_hash_set.cc +59 -39
  97. package/vendor/abseil-cpp/absl/container/internal/raw_hash_set.h +619 -326
  98. package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_benchmark.cc +25 -2
  99. package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc +4 -4
  100. package/vendor/abseil-cpp/absl/container/internal/raw_hash_set_test.cc +575 -159
  101. package/vendor/abseil-cpp/absl/container/linked_hash_map.h +2 -2
  102. package/vendor/abseil-cpp/absl/container/node_hash_map.h +27 -15
  103. package/vendor/abseil-cpp/absl/container/node_hash_map_test.cc +34 -0
  104. package/vendor/abseil-cpp/absl/container/node_hash_set.h +25 -11
  105. package/vendor/abseil-cpp/absl/container/node_hash_set_test.cc +39 -7
  106. package/vendor/abseil-cpp/absl/container/sample_element_size_test.cc +7 -4
  107. package/vendor/abseil-cpp/absl/crc/BUILD.bazel +0 -1
  108. package/vendor/abseil-cpp/absl/crc/CMakeLists.txt +2 -3
  109. package/vendor/abseil-cpp/absl/crc/crc32c_benchmark.cc +2 -1
  110. package/vendor/abseil-cpp/absl/crc/internal/cpu_detect.cc +6 -6
  111. package/vendor/abseil-cpp/absl/crc/internal/crc.cc +4 -6
  112. package/vendor/abseil-cpp/absl/crc/internal/crc32_x86_arm_combined_simd.h +41 -0
  113. package/vendor/abseil-cpp/absl/crc/internal/crc_internal.h +0 -16
  114. package/vendor/abseil-cpp/absl/crc/internal/crc_x86_arm_combined.cc +143 -81
  115. package/vendor/abseil-cpp/absl/debugging/BUILD.bazel +9 -31
  116. package/vendor/abseil-cpp/absl/debugging/CMakeLists.txt +3 -33
  117. package/vendor/abseil-cpp/absl/debugging/internal/demangle_rust.h +8 -0
  118. package/vendor/abseil-cpp/absl/debugging/internal/demangle_test.cc +2 -1
  119. package/vendor/abseil-cpp/absl/debugging/internal/examine_stack.cc +12 -2
  120. package/vendor/abseil-cpp/absl/debugging/internal/examine_stack.h +2 -3
  121. package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_aarch64-inl.inc +11 -0
  122. package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_emscripten-inl.inc +13 -4
  123. package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc +14 -7
  124. package/vendor/abseil-cpp/absl/debugging/internal/stacktrace_riscv-inl.inc +4 -0
  125. package/vendor/abseil-cpp/absl/debugging/internal/symbolize.h +46 -36
  126. package/vendor/abseil-cpp/absl/debugging/stacktrace.cc +18 -58
  127. package/vendor/abseil-cpp/absl/debugging/stacktrace.h +5 -48
  128. package/vendor/abseil-cpp/absl/debugging/stacktrace_test.cc +10 -124
  129. package/vendor/abseil-cpp/absl/debugging/symbolize.cc +20 -2
  130. package/vendor/abseil-cpp/absl/debugging/symbolize_elf.inc +58 -106
  131. package/vendor/abseil-cpp/absl/debugging/symbolize_test.cc +37 -36
  132. package/vendor/abseil-cpp/absl/debugging/symbolize_unimplemented.inc +4 -4
  133. package/vendor/abseil-cpp/absl/flags/BUILD.bazel +6 -3
  134. package/vendor/abseil-cpp/absl/flags/CMakeLists.txt +1 -1
  135. package/vendor/abseil-cpp/absl/flags/commandlineflag.h +8 -6
  136. package/vendor/abseil-cpp/absl/flags/commandlineflag_test.cc +1 -1
  137. package/vendor/abseil-cpp/absl/flags/flag_benchmark.cc +5 -5
  138. package/vendor/abseil-cpp/absl/flags/flag_test.cc +30 -30
  139. package/vendor/abseil-cpp/absl/flags/internal/flag.cc +4 -4
  140. package/vendor/abseil-cpp/absl/flags/internal/flag.h +6 -6
  141. package/vendor/abseil-cpp/absl/flags/marshalling.h +2 -28
  142. package/vendor/abseil-cpp/absl/flags/marshalling_test.cc +12 -11
  143. package/vendor/abseil-cpp/absl/flags/reflection_test.cc +1 -1
  144. package/vendor/abseil-cpp/absl/functional/BUILD.bazel +26 -1
  145. package/vendor/abseil-cpp/absl/functional/CMakeLists.txt +29 -1
  146. package/vendor/abseil-cpp/absl/functional/any_invocable.h +13 -14
  147. package/vendor/abseil-cpp/absl/functional/any_invocable_test.cc +46 -47
  148. package/vendor/abseil-cpp/absl/functional/bind_back.h +79 -0
  149. package/vendor/abseil-cpp/absl/functional/bind_back_test.cc +237 -0
  150. package/vendor/abseil-cpp/absl/functional/bind_front.h +7 -1
  151. package/vendor/abseil-cpp/absl/functional/bind_front_test.cc +4 -4
  152. package/vendor/abseil-cpp/absl/functional/function_ref_test.cc +2 -2
  153. package/vendor/abseil-cpp/absl/functional/internal/any_invocable.h +28 -28
  154. package/vendor/abseil-cpp/absl/functional/internal/back_binder.h +95 -0
  155. package/vendor/abseil-cpp/absl/functional/internal/front_binder.h +4 -4
  156. package/vendor/abseil-cpp/absl/functional/internal/function_ref.h +2 -2
  157. package/vendor/abseil-cpp/absl/functional/overload_test.cc +13 -13
  158. package/vendor/abseil-cpp/absl/hash/BUILD.bazel +1 -2
  159. package/vendor/abseil-cpp/absl/hash/CMakeLists.txt +1 -2
  160. package/vendor/abseil-cpp/absl/hash/hash.h +1 -1
  161. package/vendor/abseil-cpp/absl/hash/hash_test.cc +14 -20
  162. package/vendor/abseil-cpp/absl/hash/hash_testing.h +11 -9
  163. package/vendor/abseil-cpp/absl/hash/internal/city.cc +39 -51
  164. package/vendor/abseil-cpp/absl/hash/internal/hash.cc +165 -47
  165. package/vendor/abseil-cpp/absl/hash/internal/hash.h +86 -27
  166. package/vendor/abseil-cpp/absl/hash/internal/low_level_hash_test.cc +36 -1
  167. package/vendor/abseil-cpp/absl/hash/internal/spy_hash_state.h +8 -5
  168. package/vendor/abseil-cpp/absl/log/BUILD.bazel +5 -2
  169. package/vendor/abseil-cpp/absl/log/CMakeLists.txt +5 -3
  170. package/vendor/abseil-cpp/absl/log/absl_vlog_is_on.h +0 -2
  171. package/vendor/abseil-cpp/absl/log/internal/BUILD.bazel +15 -1
  172. package/vendor/abseil-cpp/absl/log/internal/log_message.cc +5 -4
  173. package/vendor/abseil-cpp/absl/log/internal/log_message.h +14 -0
  174. package/vendor/abseil-cpp/absl/log/internal/nullstream.h +1 -1
  175. package/vendor/abseil-cpp/absl/log/internal/proto.cc +13 -0
  176. package/vendor/abseil-cpp/absl/log/internal/structured_proto.cc +5 -5
  177. package/vendor/abseil-cpp/absl/log/internal/structured_proto.h +6 -5
  178. package/vendor/abseil-cpp/absl/log/internal/structured_proto_test.cc +3 -3
  179. package/vendor/abseil-cpp/absl/log/internal/vlog_config.cc +2 -2
  180. package/vendor/abseil-cpp/absl/log/internal/vlog_config_benchmark.cc +3 -3
  181. package/vendor/abseil-cpp/absl/log/log_format_test.cc +19 -2
  182. package/vendor/abseil-cpp/absl/log/log_modifier_methods_test.cc +18 -0
  183. package/vendor/abseil-cpp/absl/log/log_streamer.h +29 -2
  184. package/vendor/abseil-cpp/absl/log/log_streamer_test.cc +18 -0
  185. package/vendor/abseil-cpp/absl/log/scoped_mock_log_test.cc +1 -1
  186. package/vendor/abseil-cpp/absl/log/vlog_is_on.h +0 -2
  187. package/vendor/abseil-cpp/absl/log/vlog_is_on_test.cc +6 -5
  188. package/vendor/abseil-cpp/absl/memory/memory.h +55 -5
  189. package/vendor/abseil-cpp/absl/memory/memory_test.cc +55 -1
  190. package/vendor/abseil-cpp/absl/meta/BUILD.bazel +2 -0
  191. package/vendor/abseil-cpp/absl/meta/internal/requires.h +1 -1
  192. package/vendor/abseil-cpp/absl/meta/type_traits.h +119 -55
  193. package/vendor/abseil-cpp/absl/meta/type_traits_test.cc +7 -7
  194. package/vendor/abseil-cpp/absl/numeric/int128_test.cc +6 -6
  195. package/vendor/abseil-cpp/absl/profiling/BUILD.bazel +3 -1
  196. package/vendor/abseil-cpp/absl/profiling/hashtable.cc +0 -4
  197. package/vendor/abseil-cpp/absl/profiling/internal/profile_builder.cc +32 -33
  198. package/vendor/abseil-cpp/absl/profiling/internal/profile_builder.h +25 -2
  199. package/vendor/abseil-cpp/absl/profiling/internal/sample_recorder_test.cc +8 -5
  200. package/vendor/abseil-cpp/absl/random/BUILD.bazel +13 -1
  201. package/vendor/abseil-cpp/absl/random/CMakeLists.txt +23 -2
  202. package/vendor/abseil-cpp/absl/random/benchmarks.cc +1 -1
  203. package/vendor/abseil-cpp/absl/random/beta_distribution.h +2 -2
  204. package/vendor/abseil-cpp/absl/random/bit_gen_ref.h +26 -53
  205. package/vendor/abseil-cpp/absl/random/bit_gen_ref_test.cc +43 -0
  206. package/vendor/abseil-cpp/absl/random/discrete_distribution.h +1 -1
  207. package/vendor/abseil-cpp/absl/random/distributions.h +17 -17
  208. package/vendor/abseil-cpp/absl/random/distributions_test.cc +4 -4
  209. package/vendor/abseil-cpp/absl/random/exponential_distribution.h +1 -1
  210. package/vendor/abseil-cpp/absl/random/internal/BUILD.bazel +4 -2
  211. package/vendor/abseil-cpp/absl/random/internal/distribution_caller.h +8 -21
  212. package/vendor/abseil-cpp/absl/random/internal/fast_uniform_bits.h +1 -1
  213. package/vendor/abseil-cpp/absl/random/internal/generate_real.h +1 -1
  214. package/vendor/abseil-cpp/absl/random/internal/iostream_state_saver.h +2 -2
  215. package/vendor/abseil-cpp/absl/random/internal/iostream_state_saver_test.cc +3 -2
  216. package/vendor/abseil-cpp/absl/random/internal/mock_helpers.h +14 -40
  217. package/vendor/abseil-cpp/absl/random/internal/nonsecure_base.h +2 -2
  218. package/vendor/abseil-cpp/absl/random/internal/nonsecure_base_test.cc +2 -2
  219. package/vendor/abseil-cpp/absl/random/internal/pcg_engine.h +6 -6
  220. package/vendor/abseil-cpp/absl/random/internal/pcg_engine_test.cc +3 -2
  221. package/vendor/abseil-cpp/absl/random/internal/randen_detect.cc +6 -6
  222. package/vendor/abseil-cpp/absl/random/internal/randen_engine.h +2 -2
  223. package/vendor/abseil-cpp/absl/random/internal/randen_engine_test.cc +3 -2
  224. package/vendor/abseil-cpp/absl/random/internal/randen_test.cc +3 -2
  225. package/vendor/abseil-cpp/absl/random/internal/salted_seed_seq.h +6 -5
  226. package/vendor/abseil-cpp/absl/random/internal/seed_material.cc +4 -4
  227. package/vendor/abseil-cpp/absl/random/internal/seed_material.h +2 -1
  228. package/vendor/abseil-cpp/absl/random/internal/traits.h +21 -0
  229. package/vendor/abseil-cpp/absl/random/internal/traits_test.cc +5 -0
  230. package/vendor/abseil-cpp/absl/random/internal/uniform_helper.h +23 -23
  231. package/vendor/abseil-cpp/absl/random/internal/uniform_helper_test.cc +2 -1
  232. package/vendor/abseil-cpp/absl/random/mocking_access.h +74 -0
  233. package/vendor/abseil-cpp/absl/random/mocking_bit_gen.h +9 -19
  234. package/vendor/abseil-cpp/absl/random/uniform_real_distribution.h +1 -1
  235. package/vendor/abseil-cpp/absl/status/BUILD.bazel +81 -0
  236. package/vendor/abseil-cpp/absl/status/CMakeLists.txt +91 -0
  237. package/vendor/abseil-cpp/absl/status/internal/status_internal.cc +63 -18
  238. package/vendor/abseil-cpp/absl/status/internal/status_internal.h +26 -2
  239. package/vendor/abseil-cpp/absl/status/internal/status_matchers.h +22 -8
  240. package/vendor/abseil-cpp/absl/status/internal/statusor_internal.h +43 -43
  241. package/vendor/abseil-cpp/absl/status/status.cc +62 -70
  242. package/vendor/abseil-cpp/absl/status/status.h +249 -23
  243. package/vendor/abseil-cpp/absl/status/status_benchmark.cc +12 -0
  244. package/vendor/abseil-cpp/absl/status/status_builder.cc +196 -0
  245. package/vendor/abseil-cpp/absl/status/status_builder.h +978 -0
  246. package/vendor/abseil-cpp/absl/status/status_builder_test.cc +380 -0
  247. package/vendor/abseil-cpp/absl/status/status_macros.h +484 -0
  248. package/vendor/abseil-cpp/absl/status/status_macros_test.cc +634 -0
  249. package/vendor/abseil-cpp/absl/status/status_matchers.h +2 -1
  250. package/vendor/abseil-cpp/absl/status/status_matchers_test.cc +3 -4
  251. package/vendor/abseil-cpp/absl/status/status_payload_printer.h +3 -2
  252. package/vendor/abseil-cpp/absl/status/status_test.cc +443 -13
  253. package/vendor/abseil-cpp/absl/status/statusor.h +69 -36
  254. package/vendor/abseil-cpp/absl/status/statusor_test.cc +132 -35
  255. package/vendor/abseil-cpp/absl/strings/BUILD.bazel +42 -7
  256. package/vendor/abseil-cpp/absl/strings/CMakeLists.txt +33 -4
  257. package/vendor/abseil-cpp/absl/strings/ascii.h +1 -2
  258. package/vendor/abseil-cpp/absl/strings/atod_manual_test.cc +5 -5
  259. package/vendor/abseil-cpp/absl/strings/cord.cc +26 -7
  260. package/vendor/abseil-cpp/absl/strings/cord.h +23 -13
  261. package/vendor/abseil-cpp/absl/strings/cord_buffer.h +4 -2
  262. package/vendor/abseil-cpp/absl/strings/cord_test.cc +85 -9
  263. package/vendor/abseil-cpp/absl/strings/escaping.cc +183 -35
  264. package/vendor/abseil-cpp/absl/strings/escaping.h +12 -2
  265. package/vendor/abseil-cpp/absl/strings/escaping_benchmark.cc +1 -3
  266. package/vendor/abseil-cpp/absl/strings/escaping_test.cc +22 -18
  267. package/vendor/abseil-cpp/absl/strings/has_absl_stringify_test.cc +2 -2
  268. package/vendor/abseil-cpp/absl/strings/has_ostream_operator_test.cc +2 -2
  269. package/vendor/abseil-cpp/absl/strings/internal/append_and_overwrite.h +10 -10
  270. package/vendor/abseil-cpp/absl/strings/internal/cordz_sample_token_test.cc +1 -1
  271. package/vendor/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.cc +6 -0
  272. package/vendor/abseil-cpp/absl/strings/internal/damerau_levenshtein_distance.h +1 -0
  273. package/vendor/abseil-cpp/absl/strings/internal/escaping.cc +0 -141
  274. package/vendor/abseil-cpp/absl/strings/internal/escaping.h +2 -26
  275. package/vendor/abseil-cpp/absl/strings/internal/generic_printer_internal.h +23 -2
  276. package/vendor/abseil-cpp/absl/strings/internal/generic_printer_test.cc +6 -2
  277. package/vendor/abseil-cpp/absl/strings/internal/resize_uninitialized.h +31 -24
  278. package/vendor/abseil-cpp/absl/strings/internal/resize_uninitialized_test.cc +16 -41
  279. package/vendor/abseil-cpp/absl/strings/internal/stl_type_traits.h +39 -39
  280. package/vendor/abseil-cpp/absl/strings/internal/str_format/arg.h +14 -22
  281. package/vendor/abseil-cpp/absl/strings/internal/str_format/bind.h +2 -2
  282. package/vendor/abseil-cpp/absl/strings/internal/str_format/convert_test.cc +12 -20
  283. package/vendor/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc +510 -307
  284. package/vendor/abseil-cpp/absl/strings/internal/str_join_internal.h +0 -1
  285. package/vendor/abseil-cpp/absl/strings/internal/str_split_internal.h +9 -10
  286. package/vendor/abseil-cpp/absl/strings/internal/string_constant_test.cc +6 -5
  287. package/vendor/abseil-cpp/absl/strings/internal/stringify_sink.h +12 -0
  288. package/vendor/abseil-cpp/absl/strings/internal/stringify_stream.h +119 -0
  289. package/vendor/abseil-cpp/absl/strings/internal/stringify_stream_test.cc +111 -0
  290. package/vendor/abseil-cpp/absl/strings/numbers.cc +406 -0
  291. package/vendor/abseil-cpp/absl/strings/numbers.h +4 -0
  292. package/vendor/abseil-cpp/absl/strings/numbers_test.cc +33 -0
  293. package/vendor/abseil-cpp/absl/strings/resize_and_overwrite.h +10 -6
  294. package/vendor/abseil-cpp/absl/strings/str_cat.h +36 -1
  295. package/vendor/abseil-cpp/absl/strings/str_cat_benchmark.cc +1 -2
  296. package/vendor/abseil-cpp/absl/strings/str_cat_test.cc +28 -0
  297. package/vendor/abseil-cpp/absl/strings/str_join_test.cc +4 -4
  298. package/vendor/abseil-cpp/absl/strings/str_split.h +11 -6
  299. package/vendor/abseil-cpp/absl/strings/str_split_test.cc +13 -0
  300. package/vendor/abseil-cpp/absl/strings/substitute.h +2 -2
  301. package/vendor/abseil-cpp/absl/synchronization/BUILD.bazel +3 -0
  302. package/vendor/abseil-cpp/absl/synchronization/internal/create_thread_identity.cc +21 -0
  303. package/vendor/abseil-cpp/absl/synchronization/internal/per_thread_sem.h +5 -0
  304. package/vendor/abseil-cpp/absl/synchronization/mutex.cc +13 -0
  305. package/vendor/abseil-cpp/absl/synchronization/mutex.h +32 -2
  306. package/vendor/abseil-cpp/absl/synchronization/mutex_test.cc +17 -3
  307. package/vendor/abseil-cpp/absl/time/BUILD.bazel +80 -0
  308. package/vendor/abseil-cpp/absl/time/CMakeLists.txt +73 -0
  309. package/vendor/abseil-cpp/absl/time/clock.h +3 -0
  310. package/vendor/abseil-cpp/absl/time/clock_interface.cc +71 -0
  311. package/vendor/abseil-cpp/absl/time/clock_interface.h +93 -0
  312. package/vendor/abseil-cpp/absl/time/clock_interface_test.cc +128 -0
  313. package/vendor/abseil-cpp/absl/time/format.cc +3 -10
  314. package/vendor/abseil-cpp/absl/time/format_test.cc +12 -0
  315. package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc +90 -89
  316. package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_format_test.cc +80 -5
  317. package/vendor/abseil-cpp/absl/time/internal/cctz/src/time_zone_name_win.cc +1 -2
  318. package/vendor/abseil-cpp/absl/time/internal/cctz/src/tzfile.h +10 -15
  319. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/version +1 -1
  320. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Vancouver +0 -0
  321. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Ho_Chi_Minh +0 -0
  322. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Phnom_Penh +0 -0
  323. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Saigon +0 -0
  324. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tbilisi +0 -0
  325. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Vientiane +0 -0
  326. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Canada/Pacific +0 -0
  327. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Chisinau +0 -0
  328. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Europe/Tiraspol +0 -0
  329. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab +1 -1
  330. package/vendor/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab +3 -3
  331. package/vendor/abseil-cpp/absl/time/simulated_clock.cc +225 -0
  332. package/vendor/abseil-cpp/absl/time/simulated_clock.h +109 -0
  333. package/vendor/abseil-cpp/absl/time/simulated_clock_test.cc +614 -0
  334. package/vendor/abseil-cpp/absl/types/BUILD.bazel +116 -0
  335. package/vendor/abseil-cpp/absl/types/CMakeLists.txt +100 -0
  336. package/vendor/abseil-cpp/absl/types/any.h +26 -4
  337. package/vendor/abseil-cpp/absl/types/any_span.h +1067 -0
  338. package/vendor/abseil-cpp/absl/types/any_span_benchmark.cc +258 -0
  339. package/vendor/abseil-cpp/absl/types/any_span_test.cc +1210 -0
  340. package/vendor/abseil-cpp/absl/types/compare.h +4 -4
  341. package/vendor/abseil-cpp/absl/types/internal/any_span.h +477 -0
  342. package/vendor/abseil-cpp/absl/types/internal/span.h +5 -6
  343. package/vendor/abseil-cpp/absl/types/optional.h +30 -3
  344. package/vendor/abseil-cpp/absl/types/optional_ref.h +295 -0
  345. package/vendor/abseil-cpp/absl/types/optional_ref_test.cc +370 -0
  346. package/vendor/abseil-cpp/absl/types/source_location.cc +18 -0
  347. package/vendor/abseil-cpp/absl/types/source_location.h +172 -0
  348. package/vendor/abseil-cpp/absl/types/source_location_test.cc +139 -0
  349. package/vendor/abseil-cpp/absl/types/span.h +19 -23
  350. package/vendor/abseil-cpp/absl/types/variant.h +75 -18
  351. package/vendor/abseil-cpp/absl/types/variant_test.cc +23 -23
  352. package/vendor/abseil-cpp/absl/utility/BUILD.bazel +1 -0
  353. package/vendor/abseil-cpp/absl/utility/CMakeLists.txt +1 -0
  354. package/vendor/abseil-cpp/absl/utility/utility.h +99 -16
  355. package/vendor/abseil-cpp/ci/absl_alternate_options.h +2 -0
  356. package/vendor/abseil-cpp/ci/linux_arm_clang-latest_libcxx_bazel.sh +10 -4
  357. package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh +13 -6
  358. package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh +10 -4
  359. package/vendor/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh +12 -5
  360. package/vendor/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh +9 -2
  361. package/vendor/abseil-cpp/ci/linux_docker_containers.sh +4 -4
  362. package/vendor/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh +10 -3
  363. package/vendor/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh +8 -2
  364. package/vendor/abseil-cpp/ci/macos_xcode_bazel.sh +4 -3
  365. package/vendor/abseil-cpp/ci/macos_xcode_cmake.sh +2 -2
  366. package/vendor/abseil-cpp/ci/windows_clangcl_bazel.bat +1 -1
  367. package/vendor/abseil-cpp/ci/windows_msvc_bazel.bat +1 -1
  368. package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.cc +0 -118
  369. package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer.h +0 -71
  370. package/vendor/abseil-cpp/absl/debugging/internal/borrowed_fixup_buffer_test.cc +0 -97
@@ -531,6 +531,25 @@
531
531
  #define ABSL_XRAY_LOG_ARGS(N)
532
532
  #endif
533
533
 
534
+ // ABSL_ATTRIBUTE_NULL_AFTER_MOVE
535
+ //
536
+ // Indicates that a user-defined smart-pointer-like type makes guarantees on the
537
+ // state of a moved-from object, leaving it in a null state, where it can be
538
+ // used as long as it is not dereferenced. In other words, these are the same
539
+ // semantics that smart pointers from the standard library provide.
540
+ //
541
+ // The clang-tidy check bugprone-use-after-move allows member functions of types
542
+ // marked with this attribute to be called on objects that have been moved from;
543
+ // without the attribute, this would result in a use-after-move warning.
544
+ #if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) && defined(__clang__) && \
545
+ __clang_major__ >= 12
546
+ #define ABSL_ATTRIBUTE_NULL_AFTER_MOVE \
547
+ [[clang::annotate("clang-tidy", "bugprone-use-after-move", \
548
+ "null_after_move")]]
549
+ #else
550
+ #define ABSL_ATTRIBUTE_NULL_AFTER_MOVE
551
+ #endif
552
+
534
553
  // ABSL_ATTRIBUTE_REINITIALIZES
535
554
  //
536
555
  // Indicates that a member function reinitializes the entire object to a known
@@ -722,46 +741,6 @@
722
741
  #define ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING
723
742
  #endif // defined(__GNUC__) || defined(__clang__)
724
743
 
725
- // ABSL_CONST_INIT
726
- //
727
- // A variable declaration annotated with the `ABSL_CONST_INIT` attribute will
728
- // not compile (on supported platforms) unless the variable has a constant
729
- // initializer. This is useful for variables with static and thread storage
730
- // duration, because it guarantees that they will not suffer from the so-called
731
- // "static init order fiasco".
732
- //
733
- // This attribute must be placed on the initializing declaration of the
734
- // variable. Some compilers will give a -Wmissing-constinit warning when this
735
- // attribute is placed on some other declaration but missing from the
736
- // initializing declaration.
737
- //
738
- // In some cases (notably with thread_local variables), `ABSL_CONST_INIT` can
739
- // also be used in a non-initializing declaration to tell the compiler that a
740
- // variable is already initialized, reducing overhead that would otherwise be
741
- // incurred by a hidden guard variable. Thus annotating all declarations with
742
- // this attribute is recommended to potentially enhance optimization.
743
- //
744
- // Example:
745
- //
746
- // class MyClass {
747
- // public:
748
- // ABSL_CONST_INIT static MyType my_var;
749
- // };
750
- //
751
- // ABSL_CONST_INIT MyType MyClass::my_var = MakeMyType(...);
752
- //
753
- // For code or headers that are assured to only build with C++20 and up, prefer
754
- // just using the standard `constinit` keyword directly over this macro.
755
- //
756
- // Note that this attribute is redundant if the variable is declared constexpr.
757
- #if defined(__cpp_constinit) && __cpp_constinit >= 201907L
758
- #define ABSL_CONST_INIT constinit
759
- #elif ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization)
760
- #define ABSL_CONST_INIT [[clang::require_constant_initialization]]
761
- #else
762
- #define ABSL_CONST_INIT
763
- #endif
764
-
765
744
  // ABSL_REQUIRE_EXPLICIT_INIT
766
745
  //
767
746
  // ABSL_REQUIRE_EXPLICIT_INIT is placed *after* the data members of an aggregate
@@ -832,6 +811,46 @@ struct AbslInternal_YouForgotToExplicitlyInitializeAField {
832
811
  };
833
812
  #endif
834
813
 
814
+ // ABSL_CONST_INIT
815
+ //
816
+ // A variable declaration annotated with the `ABSL_CONST_INIT` attribute will
817
+ // not compile (on supported platforms) unless the variable has a constant
818
+ // initializer. This is useful for variables with static and thread storage
819
+ // duration, because it guarantees that they will not suffer from the so-called
820
+ // "static init order fiasco".
821
+ //
822
+ // This attribute must be placed on the initializing declaration of the
823
+ // variable. Some compilers will give a -Wmissing-constinit warning when this
824
+ // attribute is placed on some other declaration but missing from the
825
+ // initializing declaration.
826
+ //
827
+ // In some cases (notably with thread_local variables), `ABSL_CONST_INIT` can
828
+ // also be used in a non-initializing declaration to tell the compiler that a
829
+ // variable is already initialized, reducing overhead that would otherwise be
830
+ // incurred by a hidden guard variable. Thus annotating all declarations with
831
+ // this attribute is recommended to potentially enhance optimization.
832
+ //
833
+ // Example:
834
+ //
835
+ // class MyClass {
836
+ // public:
837
+ // ABSL_CONST_INIT static MyType my_var;
838
+ // };
839
+ //
840
+ // ABSL_CONST_INIT MyType MyClass::my_var = MakeMyType(...);
841
+ //
842
+ // For code or headers that are assured to only build with C++20 and up, prefer
843
+ // just using the standard `constinit` keyword directly over this macro.
844
+ //
845
+ // Note that this attribute is redundant if the variable is declared constexpr.
846
+ #if defined(__cpp_constinit) && __cpp_constinit >= 201907L
847
+ #define ABSL_CONST_INIT constinit
848
+ #elif ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization)
849
+ #define ABSL_CONST_INIT [[clang::require_constant_initialization]]
850
+ #else
851
+ #define ABSL_CONST_INIT
852
+ #endif
853
+
835
854
  // ABSL_ATTRIBUTE_PURE_FUNCTION
836
855
  //
837
856
  // ABSL_ATTRIBUTE_PURE_FUNCTION is used to annotate declarations of "pure"
@@ -933,7 +952,7 @@ struct AbslInternal_YouForgotToExplicitlyInitializeAField {
933
952
  // We disable this on Clang versions < 13 because of the following
934
953
  // false-positive:
935
954
  //
936
- // absl::string_view f(absl::optional<absl::string_view> sv) { return *sv; }
955
+ // absl::string_view f(std::optional<absl::string_view> sv) { return *sv; }
937
956
  //
938
957
  // See the following links for details:
939
958
  // https://reviews.llvm.org/D64448
@@ -964,7 +983,7 @@ struct AbslInternal_YouForgotToExplicitlyInitializeAField {
964
983
  // We disable this on Clang versions < 13 because of the following
965
984
  // false-positive:
966
985
  //
967
- // absl::string_view f(absl::optional<absl::string_view> sv) { return *sv; }
986
+ // absl::string_view f(std::optional<absl::string_view> sv) { return *sv; }
968
987
  //
969
988
  // See the following links for details:
970
989
  // https://reviews.llvm.org/D64448
@@ -160,6 +160,7 @@ template <typename Callable, typename... Args>
160
160
  old_control != kOnceRunning &&
161
161
  old_control != kOnceWaiter &&
162
162
  old_control != kOnceDone) {
163
+ // Memory corruption may cause this error.
163
164
  ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx",
164
165
  static_cast<unsigned long>(old_control)); // NOLINT
165
166
  }
@@ -27,8 +27,15 @@
27
27
  #include <cstring>
28
28
  #include <memory>
29
29
  #include <type_traits>
30
+ #include <typeinfo>
30
31
  #include <utility>
31
32
 
33
+ #ifdef __has_include
34
+ #if __has_include(<version>)
35
+ #include <version> // For __cpp_lib_bit_cast.
36
+ #endif
37
+ #endif
38
+
32
39
  #if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
33
40
  #include <bit> // For std::bit_cast.
34
41
  #endif // defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
@@ -204,7 +211,7 @@ inline void ValidateDownCast(From* f ABSL_ATTRIBUTE_UNUSED) {
204
211
  // Assert only if RTTI is enabled and in debug mode or hardened asserts are
205
212
  // enabled.
206
213
  #ifdef ABSL_INTERNAL_HAS_RTTI
207
- #if !defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2)
214
+ #if !defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1)
208
215
  // Suppress erroneous nonnull comparison warning on older GCC.
209
216
  #if defined(__GNUC__) && !defined(__clang__)
210
217
  #pragma GCC diagnostic push
@@ -92,8 +92,7 @@ TEST(DownCastTest, Pointer) {
92
92
  // Tests a bad downcast. We have to disguise the badness just enough
93
93
  // that the compiler doesn't warn about it at compile time.
94
94
  BaseForDownCast* base2 = new BaseForDownCast();
95
- #if GTEST_HAS_DEATH_TEST && (!defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1 || \
96
- ABSL_OPTION_HARDENED == 2))
95
+ #if GTEST_HAS_DEATH_TEST && (!defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1))
97
96
  EXPECT_DEATH(static_cast<void>(absl::down_cast<DerivedForDownCast*>(base2)),
98
97
  ".*down cast from .*BaseForDownCast.* to "
99
98
  ".*DerivedForDownCast.* failed.*");
@@ -126,8 +125,7 @@ TEST(DownCastTest, Reference) {
126
125
  // Tests a bad downcast. We have to disguise the badness just enough
127
126
  // that the compiler doesn't warn about it at compile time.
128
127
  BaseForDownCast& base2 = *new BaseForDownCast();
129
- #if GTEST_HAS_DEATH_TEST && (!defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1 || \
130
- ABSL_OPTION_HARDENED == 2))
128
+ #if GTEST_HAS_DEATH_TEST && (!defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1))
131
129
  EXPECT_DEATH(static_cast<void>(absl::down_cast<DerivedForDownCast&>(base2)),
132
130
  ".*down cast from .*BaseForDownCast.* to "
133
131
  ".*DerivedForDownCast.* failed.*");
@@ -140,8 +138,7 @@ TEST(DownCastTest, ErrorMessage) {
140
138
  BaseForDownCast& base = derived;
141
139
  (void)base;
142
140
 
143
- #if GTEST_HAS_DEATH_TEST && (!defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1 || \
144
- ABSL_OPTION_HARDENED == 2))
141
+ #if GTEST_HAS_DEATH_TEST && (!defined(NDEBUG) || (ABSL_OPTION_HARDENED == 1))
145
142
  EXPECT_DEATH(static_cast<void>(absl::down_cast<Derived2ForDownCast&>(base)),
146
143
  ".*down cast from .*DerivedForDownCast.* to "
147
144
  ".*Derived2ForDownCast.* failed.*");
@@ -117,7 +117,7 @@
117
117
  //
118
118
  // LTS releases can be obtained from
119
119
  // https://github.com/abseil/abseil-cpp/releases.
120
- #define ABSL_LTS_RELEASE_VERSION 20260107
120
+ #define ABSL_LTS_RELEASE_VERSION 20260526
121
121
  #define ABSL_LTS_RELEASE_PATCH_LEVEL 0
122
122
 
123
123
  // Helper macro to convert a CPP variable to a string literal.
@@ -531,6 +531,42 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
531
531
  #define ABSL_HAVE_STD_VARIANT 1
532
532
  #define ABSL_USES_STD_VARIANT 1
533
533
 
534
+ // ABSL_HAVE_STD_SOURCE_LOCATION
535
+ //
536
+ // Checks whether C++20 std::source_location is available.
537
+ #ifdef ABSL_HAVE_STD_SOURCE_LOCATION
538
+ #error "ABSL_HAVE_STD_SOURCE_LOCATION cannot be directly set."
539
+ #elif (defined(__cpp_lib_source_location) && \
540
+ __cpp_lib_source_location >= 201907L) || \
541
+ (defined(ABSL_INTERNAL_CPLUSPLUS_LANG) && \
542
+ ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L)
543
+ #ifdef __has_include
544
+ #if __has_include(<source_location>)
545
+ #define ABSL_HAVE_STD_SOURCE_LOCATION 1
546
+ #endif
547
+ #else
548
+ // No __has_include support, so just assume C++ language version is correct.
549
+ #define ABSL_HAVE_STD_SOURCE_LOCATION 1
550
+ #endif
551
+ #endif
552
+
553
+ // ABSL_USES_STD_SOURCE_LOCATION
554
+ //
555
+ // Indicates whether absl::SourceLocation is an alias for std::source_location.
556
+ #if !defined(ABSL_OPTION_USE_STD_SOURCE_LOCATION)
557
+ #error options.h is misconfigured.
558
+ #elif ABSL_OPTION_USE_STD_SOURCE_LOCATION == 0 || \
559
+ (ABSL_OPTION_USE_STD_SOURCE_LOCATION == 2 && \
560
+ !defined(ABSL_HAVE_STD_SOURCE_LOCATION))
561
+ #undef ABSL_USES_STD_SOURCE_LOCATION
562
+ #elif ABSL_OPTION_USE_STD_SOURCE_LOCATION == 1 || \
563
+ (ABSL_OPTION_USE_STD_SOURCE_LOCATION == 2 && \
564
+ defined(ABSL_HAVE_STD_SOURCE_LOCATION))
565
+ #define ABSL_USES_STD_SOURCE_LOCATION 1
566
+ #else
567
+ #error options.h is misconfigured.
568
+ #endif
569
+
534
570
  // ABSL_HAVE_STD_ORDERING
535
571
  //
536
572
  // Checks whether C++20 std::{partial,weak,strong}_ordering are available.
@@ -696,7 +732,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
696
732
  // Clang standalone LeakSanitizer (-fsanitize=leak)
697
733
  #elif ABSL_HAVE_FEATURE(leak_sanitizer)
698
734
  #define ABSL_HAVE_LEAK_SANITIZER 1
699
- #elif defined(ABSL_HAVE_ADDRESS_SANITIZER)
735
+ #elif defined(ABSL_HAVE_ADDRESS_SANITIZER) && !defined(_WIN32)
700
736
  // GCC or Clang using the LeakSanitizer integrated into AddressSanitizer.
701
737
  #define ABSL_HAVE_LEAK_SANITIZER 1
702
738
  #endif
@@ -799,6 +835,14 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
799
835
  #define ABSL_INTERNAL_HAVE_ARM_NEON 1
800
836
  #endif
801
837
 
838
+ #if ABSL_HAVE_BUILTIN(__builtin_LINE) && ABSL_HAVE_BUILTIN(__builtin_FILE)
839
+ #define ABSL_INTERNAL_HAVE_BUILTIN_LINE_FILE 1
840
+ #elif defined(__GNUC__) && !defined(__clang__) && 5 <= __GNUC__ && __GNUC__ < 10
841
+ #define ABSL_INTERNAL_HAVE_BUILTIN_LINE_FILE 1
842
+ #elif defined(_MSC_VER) && _MSC_VER >= 1926
843
+ #define ABSL_INTERNAL_HAVE_BUILTIN_LINE_FILE 1
844
+ #endif
845
+
802
846
  // ABSL_HAVE_CONSTANT_EVALUATED is used for compile-time detection of
803
847
  // constant evaluation support through `absl::is_constant_evaluated`.
804
848
  #ifdef ABSL_HAVE_CONSTANT_EVALUATED
@@ -838,16 +882,16 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
838
882
  #endif
839
883
  #ifdef __EMSCRIPTEN__
840
884
  #include <emscripten/version.h>
841
- #ifdef __EMSCRIPTEN_major__
842
- #if __EMSCRIPTEN_minor__ >= 1000
843
- #error __EMSCRIPTEN_minor__ is too big to fit in ABSL_INTERNAL_EMSCRIPTEN_VERSION
885
+ #ifdef __EMSCRIPTEN_MAJOR__
886
+ #if __EMSCRIPTEN_MINOR__ >= 1000
887
+ #error __EMSCRIPTEN_MINOR__ is too big to fit in ABSL_INTERNAL_EMSCRIPTEN_VERSION
844
888
  #endif
845
- #if __EMSCRIPTEN_tiny__ >= 1000
846
- #error __EMSCRIPTEN_tiny__ is too big to fit in ABSL_INTERNAL_EMSCRIPTEN_VERSION
889
+ #if __EMSCRIPTEN_TINY__ >= 1000
890
+ #error __EMSCRIPTEN_TINY__ is too big to fit in ABSL_INTERNAL_EMSCRIPTEN_VERSION
847
891
  #endif
848
892
  #define ABSL_INTERNAL_EMSCRIPTEN_VERSION \
849
- ((__EMSCRIPTEN_major__) * 1000000 + (__EMSCRIPTEN_minor__) * 1000 + \
850
- (__EMSCRIPTEN_tiny__))
893
+ ((__EMSCRIPTEN_MAJOR__) * 1000000 + (__EMSCRIPTEN_MINOR__) * 1000 + \
894
+ (__EMSCRIPTEN_TINY__))
851
895
  #endif
852
896
  #endif
853
897
 
@@ -236,8 +236,8 @@ void TestAllocatingOp(const F& f) {
236
236
  TEST(ThrowingValueTest, ThrowingAllocatingOps) {
237
237
  // make_unique calls unqualified operator new, so these exercise the
238
238
  // ThrowingValue overloads.
239
- TestAllocatingOp([]() { return absl::make_unique<ThrowingValue<>>(1); });
240
- TestAllocatingOp([]() { return absl::make_unique<ThrowingValue<>[]>(2); });
239
+ TestAllocatingOp([]() { return std::make_unique<ThrowingValue<>>(1); });
240
+ TestAllocatingOp([]() { return std::make_unique<ThrowingValue<>[]>(2); });
241
241
  }
242
242
 
243
243
  TEST(ThrowingValueTest, NonThrowingMoveCtor) {
@@ -518,7 +518,7 @@ struct NullaryTestValidator : public std::false_type {};
518
518
  template <typename TesterInstance>
519
519
  struct NullaryTestValidator<
520
520
  TesterInstance,
521
- absl::void_t<decltype(std::declval<TesterInstance>().Test())>>
521
+ std::void_t<decltype(std::declval<TesterInstance>().Test())>>
522
522
  : public std::true_type {};
523
523
 
524
524
  template <typename TesterInstance>
@@ -534,7 +534,7 @@ struct UnaryTestValidator : public std::false_type {};
534
534
  template <typename TesterInstance>
535
535
  struct UnaryTestValidator<
536
536
  TesterInstance,
537
- absl::void_t<decltype(std::declval<TesterInstance>().Test(DummyOp))>>
537
+ std::void_t<decltype(std::declval<TesterInstance>().Test(DummyOp))>>
538
538
  : public std::true_type {};
539
539
 
540
540
  template <typename TesterInstance>
@@ -546,7 +546,7 @@ TEST(ExceptionSafetyTesterTest, IncompleteTypesAreNotTestable) {
546
546
  using T = exceptions_internal::UninitializedT;
547
547
  auto op = [](T* t) {};
548
548
  auto inv = [](T*) { return testing::AssertionSuccess(); };
549
- auto fac = []() { return absl::make_unique<T>(); };
549
+ auto fac = []() { return std::make_unique<T>(); };
550
550
 
551
551
  // Test that providing operation and inveriants still does not allow for the
552
552
  // the invocation of .Test() and .Test(op) because it lacks a factory
@@ -575,7 +575,7 @@ TEST(ExceptionSafetyTesterTest, IncompleteTypesAreNotTestable) {
575
575
  struct ExampleStruct {};
576
576
 
577
577
  std::unique_ptr<ExampleStruct> ExampleFunctionFactory() {
578
- return absl::make_unique<ExampleStruct>();
578
+ return std::make_unique<ExampleStruct>();
579
579
  }
580
580
 
581
581
  void ExampleFunctionOperation(ExampleStruct*) {}
@@ -792,7 +792,7 @@ struct NonCopyable : public NonNegative {
792
792
  };
793
793
 
794
794
  TEST(ExceptionCheckTest, NonCopyable) {
795
- auto factory = []() { return absl::make_unique<NonCopyable>(); };
795
+ auto factory = []() { return std::make_unique<NonCopyable>(); };
796
796
  EXPECT_TRUE(tester.WithFactory(factory).Test());
797
797
  EXPECT_TRUE(strong_tester.WithFactory(factory).Test());
798
798
  }
@@ -945,8 +945,8 @@ TEST(ThrowingValueTraitsTest, RelationalOperators) {
945
945
  }
946
946
 
947
947
  TEST(ThrowingAllocatorTraitsTest, Assignablility) {
948
- EXPECT_TRUE(absl::is_move_assignable<ThrowingAllocator<int>>::value);
949
- EXPECT_TRUE(absl::is_copy_assignable<ThrowingAllocator<int>>::value);
948
+ EXPECT_TRUE(std::is_move_assignable<ThrowingAllocator<int>>::value);
949
+ EXPECT_TRUE(std::is_copy_assignable<ThrowingAllocator<int>>::value);
950
950
  EXPECT_TRUE(std::is_nothrow_move_assignable<ThrowingAllocator<int>>::value);
951
951
  EXPECT_TRUE(std::is_nothrow_copy_assignable<ThrowingAllocator<int>>::value);
952
952
  }
@@ -16,6 +16,8 @@
16
16
  #ifndef ABSL_BASE_FAST_TYPE_ID_H_
17
17
  #define ABSL_BASE_FAST_TYPE_ID_H_
18
18
 
19
+ #include <utility>
20
+
19
21
  #include "absl/base/config.h"
20
22
 
21
23
  namespace absl {
@@ -29,14 +31,40 @@ struct FastTypeTag {
29
31
  } // namespace base_internal
30
32
 
31
33
  // The type returned by `absl::FastTypeId<T>()`.
32
- using FastTypeIdType = const void*;
34
+ class FastTypeIdType final {
35
+ public:
36
+ // Creates a value that does not correspond to any type. This value is
37
+ // distinct from any value returned by `FastTypeId<T>()`.
38
+ constexpr FastTypeIdType() = default;
39
+
40
+ template <typename H>
41
+ friend H AbslHashValue(H h, FastTypeIdType x) {
42
+ return H::combine(std::move(h), x.ptr_);
43
+ }
44
+
45
+ friend constexpr bool operator==(FastTypeIdType a, FastTypeIdType b) {
46
+ return a.ptr_ == b.ptr_;
47
+ }
48
+ friend constexpr bool operator!=(FastTypeIdType a, FastTypeIdType b) {
49
+ return a.ptr_ != b.ptr_;
50
+ }
51
+
52
+ private:
53
+ // `FastTypeId<T>()` is the generator method for FastTypeIdType values.
54
+ template <typename T>
55
+ friend constexpr FastTypeIdType FastTypeId();
56
+
57
+ explicit constexpr FastTypeIdType(const void* ptr) : ptr_(ptr) {}
58
+
59
+ const void* ptr_ = nullptr;
60
+ };
33
61
 
34
62
  // `absl::FastTypeId<Type>()` evaluates at compile-time to a unique id for the
35
63
  // passed-in type. These are meant to be good match for keys into maps or
36
64
  // straight up comparisons.
37
65
  template <typename Type>
38
66
  constexpr FastTypeIdType FastTypeId() {
39
- return &base_internal::FastTypeTag<Type>::kDummyVar;
67
+ return FastTypeIdType(&base_internal::FastTypeTag<Type>::kDummyVar);
40
68
  }
41
69
 
42
70
  ABSL_NAMESPACE_END
@@ -24,6 +24,9 @@
24
24
 
25
25
  namespace {
26
26
 
27
+ // Ensure that absl::bit_cast works between FastTypeIdType and void*.
28
+ static_assert(sizeof(absl::FastTypeIdType) == sizeof(void*));
29
+
27
30
  // NOLINTBEGIN(runtime/int)
28
31
  #define PRIM_TYPES(A) \
29
32
  A(bool) \
@@ -14,6 +14,8 @@
14
14
 
15
15
  // Utilities for testing exception-safety
16
16
 
17
+ // SKIP_ABSL_INLINE_NAMESPACE_CHECK
18
+
17
19
  #ifndef ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_
18
20
  #define ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_
19
21
 
@@ -38,28 +40,29 @@
38
40
  #include "absl/strings/substitute.h"
39
41
  #include "absl/utility/utility.h"
40
42
 
43
+ // TODO(b/500018833): Update the namespace as appropriate.
41
44
  namespace testing {
42
45
 
43
46
  enum class TypeSpec;
44
47
  enum class AllocSpec;
45
48
 
46
49
  constexpr TypeSpec operator|(TypeSpec a, TypeSpec b) {
47
- using T = absl::underlying_type_t<TypeSpec>;
50
+ using T = std::underlying_type_t<TypeSpec>;
48
51
  return static_cast<TypeSpec>(static_cast<T>(a) | static_cast<T>(b));
49
52
  }
50
53
 
51
54
  constexpr TypeSpec operator&(TypeSpec a, TypeSpec b) {
52
- using T = absl::underlying_type_t<TypeSpec>;
55
+ using T = std::underlying_type_t<TypeSpec>;
53
56
  return static_cast<TypeSpec>(static_cast<T>(a) & static_cast<T>(b));
54
57
  }
55
58
 
56
59
  constexpr AllocSpec operator|(AllocSpec a, AllocSpec b) {
57
- using T = absl::underlying_type_t<AllocSpec>;
60
+ using T = std::underlying_type_t<AllocSpec>;
58
61
  return static_cast<AllocSpec>(static_cast<T>(a) | static_cast<T>(b));
59
62
  }
60
63
 
61
64
  constexpr AllocSpec operator&(AllocSpec a, AllocSpec b) {
62
- using T = absl::underlying_type_t<AllocSpec>;
65
+ using T = std::underlying_type_t<AllocSpec>;
63
66
  return static_cast<AllocSpec>(static_cast<T>(a) & static_cast<T>(b));
64
67
  }
65
68
 
@@ -834,7 +837,7 @@ template <typename T>
834
837
  class DefaultFactory {
835
838
  public:
836
839
  explicit DefaultFactory(const T& t) : t_(t) {}
837
- std::unique_ptr<T> operator()() const { return absl::make_unique<T>(t_); }
840
+ std::unique_ptr<T> operator()() const { return std::make_unique<T>(t_); }
838
841
 
839
842
  private:
840
843
  T t_;
@@ -842,7 +845,7 @@ class DefaultFactory {
842
845
 
843
846
  template <size_t LazyContractsCount, typename LazyFactory,
844
847
  typename LazyOperation>
845
- using EnableIfTestable = typename absl::enable_if_t<
848
+ using EnableIfTestable = typename std::enable_if_t<
846
849
  LazyContractsCount != 0 &&
847
850
  !std::is_same<LazyFactory, UninitializedT>::value &&
848
851
  !std::is_same<LazyOperation, UninitializedT>::value>;
@@ -994,7 +997,7 @@ class ExceptionSafetyTestBuilder {
994
997
  * method tester.WithInitialValue(...).
995
998
  */
996
999
  template <typename NewFactory>
997
- ExceptionSafetyTestBuilder<absl::decay_t<NewFactory>, Operation, Contracts...>
1000
+ ExceptionSafetyTestBuilder<std::decay_t<NewFactory>, Operation, Contracts...>
998
1001
  WithFactory(const NewFactory& new_factory) const {
999
1002
  return {new_factory, operation_, contracts_};
1000
1003
  }
@@ -1005,7 +1008,7 @@ class ExceptionSafetyTestBuilder {
1005
1008
  * newly created tester.
1006
1009
  */
1007
1010
  template <typename NewOperation>
1008
- ExceptionSafetyTestBuilder<Factory, absl::decay_t<NewOperation>, Contracts...>
1011
+ ExceptionSafetyTestBuilder<Factory, std::decay_t<NewOperation>, Contracts...>
1009
1012
  WithOperation(const NewOperation& new_operation) const {
1010
1013
  return {factory_, new_operation, contracts_};
1011
1014
  }
@@ -1025,11 +1028,11 @@ class ExceptionSafetyTestBuilder {
1025
1028
  */
1026
1029
  template <typename... MoreContracts>
1027
1030
  ExceptionSafetyTestBuilder<Factory, Operation, Contracts...,
1028
- absl::decay_t<MoreContracts>...>
1031
+ std::decay_t<MoreContracts>...>
1029
1032
  WithContracts(const MoreContracts&... more_contracts) const {
1030
1033
  return {
1031
1034
  factory_, operation_,
1032
- std::tuple_cat(contracts_, std::tuple<absl::decay_t<MoreContracts>...>(
1035
+ std::tuple_cat(contracts_, std::tuple<std::decay_t<MoreContracts>...>(
1033
1036
  more_contracts...))};
1034
1037
  }
1035
1038
 
@@ -1053,7 +1056,7 @@ class ExceptionSafetyTestBuilder {
1053
1056
  typename NewOperation,
1054
1057
  typename = EnableIfTestable<sizeof...(Contracts), Factory, NewOperation>>
1055
1058
  testing::AssertionResult Test(const NewOperation& new_operation) const {
1056
- return TestImpl(new_operation, absl::index_sequence_for<Contracts...>());
1059
+ return TestImpl(new_operation, std::index_sequence_for<Contracts...>());
1057
1060
  }
1058
1061
 
1059
1062
  /*
@@ -1089,7 +1092,7 @@ class ExceptionSafetyTestBuilder {
1089
1092
 
1090
1093
  template <typename SelectedOperation, size_t... Indices>
1091
1094
  testing::AssertionResult TestImpl(SelectedOperation selected_operation,
1092
- absl::index_sequence<Indices...>) const {
1095
+ std::index_sequence<Indices...>) const {
1093
1096
  return ExceptionSafetyTest<FactoryElementType<Factory>>(
1094
1097
  factory_, selected_operation, std::get<Indices>(contracts_)...)
1095
1098
  .Test();
@@ -0,0 +1,136 @@
1
+ //
2
+ // Copyright 2026 The Abseil Authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // https://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ // -----------------------------------------------------------------------------
17
+ // File: hardening.h
18
+ // -----------------------------------------------------------------------------
19
+ //
20
+ // This header file defines macros and functions for performing Abseil
21
+ // hardening checks and aborts.
22
+
23
+ #ifndef ABSL_BASE_INTERNAL_HARDENING_H_
24
+ #define ABSL_BASE_INTERNAL_HARDENING_H_
25
+
26
+ #include "absl/base/config.h"
27
+ #include "absl/base/macros.h"
28
+ #include "absl/base/options.h"
29
+
30
+ namespace absl {
31
+ ABSL_NAMESPACE_BEGIN
32
+
33
+ namespace base_internal {
34
+
35
+ // `HardeningAssert` performs runtime checks when Abseil Hardening is enabled,
36
+ // even if `NDEBUG` is defined.
37
+ //
38
+ // When `NDEBUG` is not defined, `HardeningAssert`'s behavior is identical to
39
+ // `ABSL_ASSERT`.
40
+ //
41
+ // Prefer a more specific assertion function over this more general one,
42
+ // as assertion functions which perform the comparison themselves
43
+ // can have the cost of the comparison attributed to them.
44
+ constexpr void HardeningAssert(bool cond) {
45
+ ABSL_ASSERT(cond);
46
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
47
+ if (ABSL_PREDICT_FALSE(!cond)) {
48
+ base_internal::HardeningAbort();
49
+ }
50
+ #endif
51
+ }
52
+
53
+ // `HardeningAssertSlow` is used to perform runtime checks which are too
54
+ // computationally expensive to enable widely by default.
55
+ //
56
+ // When `NDEBUG` is not defined, `HardeningAssertSlow`'s behavior is identical
57
+ // to `ABSL_ASSERT`.
58
+ constexpr void HardeningAssertSlow(bool cond) {
59
+ ABSL_ASSERT(cond);
60
+ #if (ABSL_OPTION_HARDENED == 1) && defined(NDEBUG)
61
+ if (ABSL_PREDICT_FALSE(!cond)) {
62
+ base_internal::HardeningAbort();
63
+ }
64
+ #endif
65
+ }
66
+
67
+ template <typename T>
68
+ constexpr void HardeningAssertGT(T val1, T val2) {
69
+ ABSL_ASSERT(val1 > val2);
70
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
71
+ if (!ABSL_PREDICT_TRUE(val1 > val2)) {
72
+ base_internal::HardeningAbort();
73
+ }
74
+ #endif
75
+ }
76
+
77
+ template <typename T>
78
+ constexpr void HardeningAssertGE(T val1, T val2) {
79
+ ABSL_ASSERT(val1 >= val2);
80
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
81
+ if (!ABSL_PREDICT_TRUE(val1 >= val2)) {
82
+ base_internal::HardeningAbort();
83
+ }
84
+ #endif
85
+ }
86
+
87
+ template <typename T>
88
+ constexpr void HardeningAssertLT(T val1, T val2) {
89
+ ABSL_ASSERT(val1 < val2);
90
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
91
+ if (!ABSL_PREDICT_TRUE(val1 < val2)) {
92
+ base_internal::HardeningAbort();
93
+ }
94
+ #endif
95
+ }
96
+
97
+ template <typename T>
98
+ constexpr void HardeningAssertLE(T val1, T val2) {
99
+ ABSL_ASSERT(val1 <= val2);
100
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
101
+ if (!ABSL_PREDICT_TRUE(val1 <= val2)) {
102
+ base_internal::HardeningAbort();
103
+ }
104
+ #endif
105
+ }
106
+
107
+ constexpr void HardeningAssertInBounds(size_t index, size_t size) {
108
+ HardeningAssertLT(index, size);
109
+ }
110
+
111
+ template <typename T>
112
+ constexpr void HardeningAssertNonEmpty(const T& container) {
113
+ ABSL_ASSERT(!container.empty());
114
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
115
+ if (ABSL_PREDICT_FALSE(container.empty())) {
116
+ base_internal::HardeningAbort();
117
+ }
118
+ #endif
119
+ }
120
+
121
+ template <typename T>
122
+ constexpr void HardeningAssertNonNull(T ptr) {
123
+ ABSL_ASSERT(ptr != nullptr);
124
+ #if (ABSL_OPTION_HARDENED == 1 || ABSL_OPTION_HARDENED == 2) && defined(NDEBUG)
125
+ if (ABSL_PREDICT_FALSE(ptr == nullptr)) {
126
+ base_internal::HardeningAbort();
127
+ }
128
+ #endif
129
+ }
130
+
131
+ } // namespace base_internal
132
+
133
+ ABSL_NAMESPACE_END
134
+ } // namespace absl
135
+
136
+ #endif // ABSL_BASE_INTERNAL_HARDENING_H_