3377 Commits

Author SHA1 Message Date
Abseil Team
213609f5c8 Fix a bug in LogMessage::CopyToEncodedBufferWithStructuredProtoField where all strings are encoded as not literal strings.
PiperOrigin-RevId: 917976428
Change-Id: Idd6b77216dccdbd761748f185fb466b716fff38b
2026-05-19 12:50:06 -07:00
Abseil Team
ad00fb75a8 Disable ABSL_DEFINE_UNQUALIFIED_STATUS_MACROS in OSS
PiperOrigin-RevId: 917960707
Change-Id: I2bf388a82f324d63f45ea44929847fdc19f84d7a
2026-05-19 12:16:37 -07:00
Abseil Team
23837c607e Prefix ABSL_ to ASSIGN_OR_RETURN() and RETURN_IF_ERROR() macros and use ABSL_DEFINE_UNQUALIFIED_STATUS_MACROS to enable them
Also temporarily define ABSL_DEFINE_UNQUALIFIED_STATUS_MACROS until we turn it off in OSS. (I split these up to make them easier to submit & revert, given I wanted TGPs for both.)

PiperOrigin-RevId: 917868888
Change-Id: I3e1128f5838f8fa988b90b9c4d1b794e7f0bbdfc
2026-05-19 09:13:49 -07:00
Derek Mauro
2d5f437f35 Enforce GCC 10 and MSVC 2022 minimum
https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md

PiperOrigin-RevId: 917839505
Change-Id: I9a3841f819edeb2daed547dd721bbdbcf265b17d
2026-05-19 08:04:20 -07:00
Abseil Team
1ea7b9254f Undo deprecate and inline of absl::optional and absl::nullopt
PiperOrigin-RevId: 916628855
Change-Id: Iadbb9574d526aa1b6d65992135de21529600fc01
2026-05-16 20:27:56 -07:00
Abseil Team
18e7230eee Fix visibility issue in absl/log/internal:flags
PiperOrigin-RevId: 916300899
Change-Id: I219afa7d0fd85e950a05e569cb151e414358b325
2026-05-15 20:03:24 -07:00
Abseil Team
7eaa5fbb22 Deprecate and inline absl::optional and absl::nullopt
PiperOrigin-RevId: 916205787
Change-Id: I3b9e732184f45fc33f7c9fc3976c27b45bce81f9
2026-05-15 15:16:24 -07:00
Abseil Team
b0e44a92f8 Refactor size checks in c_copy and c_copy_n to use base_internal::HardeningAssert.
PiperOrigin-RevId: 916158503
Change-Id: Ie3565d3a8a2c3a983af794078b01c18beb1d49b9
2026-05-15 13:33:19 -07:00
Abseil Team
a20313e890 Deprecate and inline historical functions in Abseil
PiperOrigin-RevId: 916125223
Change-Id: I79a4bb099685ef9119718f5ab468fdb2aff21ed0
2026-05-15 12:17:13 -07:00
Abseil Team
07389c2182 Remove unused leftover STATUS_MACROS_... macros
PiperOrigin-RevId: 916122109
Change-Id: Ic4aeb927a67d755153f4bad2ca36467730cc2a65
2026-05-15 12:10:43 -07:00
Abseil Team
98583eccc8 Deprecate and inline absl::apply
PiperOrigin-RevId: 916044225
Change-Id: I526618be54733fed7d7fd68480c96a2c41e47eb3
2026-05-15 09:34:02 -07:00
Evan Brown
d936f59065 Move dereferences that crash when the iterator is invalid into the new CrashIfIteratorIsInvalid function in order to give more helpful stack traces.
PiperOrigin-RevId: 915656842
Change-Id: I8542ce08c37d44f35a85e666eaf7eccd46132aef
2026-05-14 15:48:35 -07:00
Abseil Team
c20be0a44d Add absl::StatusBuilder and status macros (ASSIGN_OR_RETURN, RETURN_IF_ERROR, etc.)
PiperOrigin-RevId: 915476143
Change-Id: If1ce23cf40e4e44c39164f81f6d5ca66988d405c
2026-05-14 09:45:04 -07:00
Milad Fa
d885e62bc8 PR #2051: Fix absl_stacktrace_test on s390x
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2051

Commit 33bbc26 made changes to stacktrace_emscripten-inl.inc but did not change the stacktrace_generic-inl.inc file. This caused `absl_stacktrace_test` to fail on s390x.
```
Expected: (results[i]) != (nullptr), actual: NULL vs (nullptr)
Unexpected nullptr found at index 14

[  FAILED  ] StackTrace.NoNullptrInPopulatedRange (0 ms)
```
This patch applies the same logic to stacktrace_generic-inl.inc.
Merge b2fef211b0 into 89203a0303

Merging this change closes #2051

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/2051 from miladfarca:fix-33bbc26 b2fef211b0
PiperOrigin-RevId: 915361786
Change-Id: Iafb02166414df57845410457796758a97bcc253a
2026-05-14 04:36:26 -07:00
Abseil Team
ca1d7cb497 Add container overloads for absl::c_copy and absl::c_copy_n
These versions accept a container as the output destination. The primary motivation for these overloads is to add bounds checking. We determine if an object is a container by checking if they support `std::begin`/`std::end`.

PiperOrigin-RevId: 915035028
Change-Id: Ibeb17b784ec313215ba8216a6085628d11eac102
2026-05-13 13:43:47 -07:00
Connal de Souza
0c60e214e9 Remove PCLMUL steam on AMD Rome, as it appears to be marginally faster without it.
PiperOrigin-RevId: 914995032
Change-Id: I642095189cf36e7cf1dcaa44e8bfb97246158831
2026-05-13 12:26:43 -07:00
Evan Brown
c349faaf18 Refactor HashtableCapacity code to force using bzhi when available (and when capacity-by-log is enabled, which is non-default).
Also:
- Adds type safety for probe overloads, which has been a source of bugs for me in the past so I think it should be useful regardless of whether log-based-capacity lands.
- Adds an assertion for IsValid() when getting capacity from CommonFields and not calling maybe_invalid_capacity().

Note that this is a no-op (other than the new assertion) when capacity-by-log is disabled (default behavior).

PiperOrigin-RevId: 914932479
Change-Id: I86fd20ea27048ad6dfdf39da54f3f300cc7af4f9
2026-05-13 10:21:26 -07:00
Abseil Team
a7fbfa4486 Add [[clang::nomerge]] to absl::base_internal::HardeningAbort()
This lets us distinguish crashes due to different hardening checks.

PiperOrigin-RevId: 914894842
Change-Id: I5a875bceac5ae398308c5edaa45fea952fec501f
2026-05-13 09:03:01 -07:00
Derek Mauro
89203a0303 Update Abseil deps in preparation for release
PiperOrigin-RevId: 914597435
Change-Id: I8e2551dc51be13bbdb04ec56b3fe27eaea3ee8a3
2026-05-12 19:28:46 -07:00
Abseil Team
d4aba0a323 Deprecate and inline historical functions in Abseil
Migrates uses of absl:: symbols to std:: symbols

PiperOrigin-RevId: 914475818
Change-Id: I35908b9d91b4fba465b9fe3e5b2c8f497f2f192b
2026-05-12 14:21:33 -07:00
Derek Mauro
bc5e9d0ce0 Abseil CI updates:
* GCC latest is now 16.1
  * GCC floor is 10.5.0
  * CMake 4.3.2"
  * Clang/LLVM 22.1.0"
  * Bazel 9.1.0

The new Linux docker containers now refer to their SHA256
instead of a tag in the configuration file.

PiperOrigin-RevId: 914372195
Change-Id: I39cb89b922a4b829f9e045790742de9b765b210f
2026-05-12 10:58:57 -07:00
Abseil Team
33bbc26609 Break on nullptr return address in UnwindImpl on RISC-V
PiperOrigin-RevId: 914222352
Change-Id: Iff9028a38e878465961f71e90484c2a62ed89132
2026-05-12 05:13:17 -07:00
Derek Mauro
5704b72fe0 Fix absl::make_unique_for_overwrite test under GCC 16
Dead-store elimination and lifetime analysis are breaking and/or
causing warnings for the initialization tests. Inhibit optimization to
prevent this.

PiperOrigin-RevId: 913929059
Change-Id: I2a748f9d18607c0cde99d184e4158cd6e1d4c6ad
2026-05-11 16:06:28 -07:00
Vitaly Goldshteyn
ae7be71bd8 Optimize is_small() checks in raw_hash_set for log-based capacity.
Comparing capacity_data_ directly leads to a better generated code.
One byte comparison is used before computing the capacity in order to detect small tables.

On x86 the diff for critical path detection of small table:
```
48 c7 c1 ff ff ff ff movq $-0x1, %rcx                                ~~~> a8 fe                testb $-0x2, %al
c4 e2 f9 f7 c9       shlxq %rax, %rcx, %rcx                          ~~~>
48 83 f9 fe          cmpq $-0x2, %rcx                                ~~~>
```

PiperOrigin-RevId: 913716016
Change-Id: I264cc3051e359632a2af5a4a196f44ed272dedc2
2026-05-11 08:37:20 -07:00
Vitaly Goldshteyn
e309302b7a Added handle to make HashtableInlineData store log-based capacity based on compile time flag.
That is important to facilitate experimentation with log-based capacity mode.

PiperOrigin-RevId: 913613088
Change-Id: I6d328d5b8866623a24b9b639271b239794bc384c
2026-05-11 03:44:13 -07:00
Abseil Team
30bba84041 Roll back changing abseil hardening assertion in any_invocable from macro to function
This change broke rust wrappers for any_invocable due to templating issues.

PiperOrigin-RevId: 912760874
Change-Id: Ia0303e011e384e2cca284e393e59c0301974394e
2026-05-08 17:00:13 -07:00
Abseil Team
723c2e7c8a Change abseil hardening assertion in any_invocable from macro to function
This associates debug information with the assertion site,
allowing clearer stack-traces for assertion failures and
better accounting of the performance overhead of assertions.

PiperOrigin-RevId: 912616493
Change-Id: I3bcaa8d24fc7d9adc04e67fe228bf418bb5eb842
2026-05-08 11:35:33 -07:00
Derek Mauro
659ba44acf absl::Substitute: Set variables in the correct order to avoid an
uninitialized variable warning in GCC 10

PiperOrigin-RevId: 912616225
Change-Id: Ieb72a17cdfdbff66df6d04b9b87b8eb03bbfb30d
2026-05-08 11:34:47 -07:00
Derek Mauro
638e17aedd Add absl::CopyCordToSpan()
PiperOrigin-RevId: 912247630
Change-Id: Ie5d2837c9b878e6094dce4d2ec7e60441a7c6bb7
2026-05-07 17:55:11 -07:00
Abseil Team
d0d4c59910 Deprecate and inline some historical inline variables in Abseil
PiperOrigin-RevId: 911711219
Change-Id: Icf6fa5f06d4c9f251d1f4139f942182c078db743
2026-05-06 20:55:45 -07:00
Abseil Team
9517566568 Change abseil hardening assertions in cleanup from macros to functions
This associates debug information with the assertion sites,
allowing clearer stack-traces for assertion failures and
better accounting of the performance overhead of assertions.

PiperOrigin-RevId: 911622698
Change-Id: If981469b9da24c83a97534db2aa579ee21c9547c
2026-05-06 16:50:58 -07:00
Evan Brown
e68f11887b Update AssertIsValidForComparison to have better comments for cases in which there are sanitizer crashes that we can't give a good assertion failure message for.
Also add a test for comparing an iterator from a moved from table.

PiperOrigin-RevId: 911594422
Change-Id: I72ed53b5db81fb7f9656979d406ac7729eb20dc5
2026-05-06 15:52:58 -07:00
Abseil Team
9855fba735 Change abseil hardening assertions in btree from macros to functions
This associates debug information with the assertion sites,
allowing clearer stack-traces for assertion failures and
better accounting of the performance overhead of assertions.

PiperOrigin-RevId: 911469342
Change-Id: I04a0d709b9e2a7fedf59cfce1d65a431009bbd1e
2026-05-06 12:03:19 -07:00
Abseil Team
271ba2770d Change abseil hardening assertions in chunked_queue and fixed_array from macros to functions
This associates debug information with the assertion sites,
allowing clearer stack-traces for assertion failures and
better accounting of the performance overhead of assertions.

PiperOrigin-RevId: 911422559
Change-Id: Ifce3fd62685173c6b2f83c4c4e4c97c152a463b1
2026-05-06 10:42:30 -07:00
Chris Kennelly
4dcbb5982d Add VMA naming fallback for LowLevelAlloc.
PiperOrigin-RevId: 911021583
Change-Id: I3fc632b8b142cc738ced0dbb40d5eef87cc30cf4
2026-05-05 18:11:32 -07:00
Derek Mauro
97aea89f78 Add a comment about the dataflow to //absl/log/internal/proto.cc
for the benefit people using of AI to scan the code

This will hopefully prevent pull-requests like #2045 that see a local
problem with DecodeVarint() without understanding the larger picture.

See https://github.com/abseil/abseil-cpp/pull/2045

PiperOrigin-RevId: 910971345
Change-Id: I76e1524e4577799ae391716928f10b7fff82e112
2026-05-05 16:12:31 -07:00
Abseil Team
bd6adb86c2 Change abseil hardening assertions in the strings directory from macros to functions
This associates debug information with the assertion sites, allowing clearer stack-traces for assertion failures and better accounting of the performance overhead of assertions.

PiperOrigin-RevId: 910863016
Change-Id: Ic615a9eeb8ad4b3f8c035074df4ff8347190e5c7
2026-05-05 13:00:46 -07:00
Abseil Team
34a2c1eb25 Change abseil hardening assertions in inlined_vector from macros to functions
This associates debug information with the assertion sites,
allowing clearer stack-traces for assertion failures and
better accounting of the performance overhead of assertions.

PiperOrigin-RevId: 910765631
Change-Id: I61d32bae842c00772f2ed09fb092bd20fa74b70c
2026-05-05 10:22:33 -07:00
Abseil Team
c7a875c193 Rollback of
Add [[clang::nomerge]] to absl::base_internal::HardeningAbort()

This lets us distinguish crashes due to different hardening checks.

PiperOrigin-RevId: 910658969
Change-Id: I820eb5291d7ce8330df0dac10ea09fafef405bbb
2026-05-05 06:58:56 -07:00
Abseil Team
d061f5f134 Add [[clang::nomerge]] to absl::base_internal::HardeningAbort()
This lets us distinguish crashes due to different hardening checks.

PiperOrigin-RevId: 910325607
Change-Id: I902df2b849af9dcc0330315cf913d9ed63163bc1
2026-05-04 17:09:23 -07:00
Mike Kruskal
74b81df26c Fix aarch64 stacktrace unwinding.
PiperOrigin-RevId: 910322805
Change-Id: I7a4b80e306ebfe62f36098376c4e4df396ddb8dc
2026-05-04 17:02:17 -07:00
Abseil Team
db10d46386 Change inlined_vector internal consistency assertions to ABSL_ASSERT from ABSL_HARDENING_ASSERT
Several assertions check invariants based on a small set of known callers,
rather than being spatial-safety-related bounds checks.
ABSL_ASSERT is better suited for these checks than ABSL_HARDENING_ASSERT.

PiperOrigin-RevId: 910245176
Change-Id: I7bdeba57219a0d52a359c1af757ee4af4c021ce9
2026-05-04 14:30:53 -07:00
Abseil Team
49fe184484 Deprecate and inline historical typedefs in Abseil
PiperOrigin-RevId: 910228893
Change-Id: I35c700e73c665f7eff07bd069a79905146e9d50b
2026-05-04 14:01:46 -07:00
Abseil Team
8f7e820769 Deprecate and inline absl::variant
PiperOrigin-RevId: 910095755
Change-Id: If517f379a6ada76fd447f0568726805bc37436bb
2026-05-04 10:10:08 -07:00
Abseil Team
ef23debede Deprecate and inline absl::index_sequence
PiperOrigin-RevId: 910095727
Change-Id: I9f175172108186e03559409be2eb1a0600b6a225
2026-05-04 10:09:38 -07:00
Taylor Cramer
deaf349205 Update to layout-compatible StatusCode and StatusCodeError types
PiperOrigin-RevId: 908887690
Change-Id: Ie68f8cc70658b8551b17cd8f9b3bdb4b23916f88
2026-05-01 14:02:18 -07:00
Abseil Team
7dcc24cf19 Factor out ABSL_INTERNAL_UNEVALUATED() from ABSL_ASSERT()
This makes the logic clearer and also allows reuse in other macros in the future, such as hardened assertions.

PiperOrigin-RevId: 908751829
Change-Id: Ic6f2e77755718db1df86510145e16e2ba6c83bcb
2026-05-01 08:44:13 -07:00
Derek Mauro
acbfcef618 Add an absl::StrCat floating-point formatter absl::HighPrecision
absl::HighPrecision produces a string with enough precision that it
can be parsed back to the original floating-point value.
PiperOrigin-RevId: 908689724
Change-Id: Ib076de9e32b0168ce587ea676088f05c8abe7e95
2026-05-01 05:50:23 -07:00
Abseil Team
06534e0cf0 Add VMA naming fallback for LowLevelAlloc.
PiperOrigin-RevId: 908180914
Change-Id: If5266fa8ec5b8777fe7546b2454a562d7e26e0b8
2026-04-30 08:05:27 -07:00
Chris Kennelly
5193aa7983 Add VMA naming fallback for LowLevelAlloc.
PiperOrigin-RevId: 908158129
Change-Id: I79c2677133567272be22cc0a4d73fda99efc15d9
2026-04-30 07:20:22 -07:00