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
This will let us deprecate the declarations without triggering warnings in Abseil itself.
PiperOrigin-RevId: 906360966
Change-Id: Iee362ac0eac647909ef38003280f1179813f764d
absl::variant, and related types
The corresponding headers are removed from cc files, but kept in
headers to prevent breakages from transitive dependencies.
PiperOrigin-RevId: 872421685
Change-Id: I867d4c3f7c9e422289c63816d44719b0530fb0a6
instead of just trying to be MSVC
This also fixes the new warnings that are caught.
These include:
* Unreachable code after GTEST_SKIP (this is kind of ugly)
* Some -Wundef warnings
* A -Wshadow warning in vlog_config.cc
PiperOrigin-RevId: 838046186
Change-Id: Ief48d6db2b8755d2173997d052560880593d5819
instead of just trying to be MSVC
This also fixes the new warnings that are caught.
These include:
* Unreachable code after GTEST_SKIP (this is kind of ugly)
* Some -Wundef warnings
* A -Wshadow warning in vlog_config.cc
PiperOrigin-RevId: 838017208
Change-Id: I39373c0ccc57c8660c22815c51ac5b4180aec53c
Printing as pointers is more relevant to the result of the comparison.
PiperOrigin-RevId: 824656335
Change-Id: I3b586e633c1271c1728c961193db106e4f4e5a8b
instantiate std::underlying_type for non-num types.
Before cpp20 using std::underlying_t on non enum types is undefined behaviour.
PiperOrigin-RevId: 806567586
Change-Id: I5e0694d52296b33a4d3689fa464139319f48429e
when C-style strings are compared
Regression introduced in 57bc7edd87
PiperOrigin-RevId: 800142107
Change-Id: Ibafe2dc58b1d1cb0e24e3e0c36d095d35a5f7bd3
This change allows values of a scoped enum (that is, an `enum class` or `enum struct`) to be passed to CHECK_EQ and its relatives (CHECK_NE, DCHECK_GE, etc). Before this change, this was not possible because enum class values could not be printed without a custom operator<< or AbslStringify implementation. This change adds support by converting the scoped-enum values to their underlying types for printing purposes when a CHECK_XX fails. If a scoped enum already has operator<< or AbslStringify defined, those methods are still preferred.
One design detail: enums can have char as their underlying type. For consistency with unscoped enums, a char-backed scoped enum is printed as an ASCII character when its value is in the printable ASCII range (decimal 32 to 126).
PiperOrigin-RevId: 771129686
Change-Id: I4d0ba0f4e1dc1264df4ee8d0230d3dbd02581c9b
The `wcsnlen` function is not consistently available across all target environments. Its prior use was intended as a micro-optimization and safeguard to limit string scanning to the remaining buffer size and prevent potential issues with malformed strings lacking a null terminator.
This change now relies on the implicit `std::wstring_view` constructor to determine the string length. `CopyToEncodedBuffer` will continue to handle truncation effectively, mitigating the original concerns.
PiperOrigin-RevId: 756378282
Change-Id: I858bad01724507f7926f868aa300eabad8a4358c
The logged strings are truncated to fit the available buffer in the same way as regular strings.
Invalid characters are replaced by the replacement char (`U+FFFD`).
Wide string literals are recorded as literals in `logging.proto.Value`.
PiperOrigin-RevId: 756052375
Change-Id: If3960b4230f923061028bd738eb209b5a82a31eb
the Clang version used in the Linux ARM CI to Clang 19.
nullability-completeness is an all-or-nothing warning, and it is
enabled by default. If anything is annotated, everything has to be
annotated.
There are a few types of fixes in this change. The most common is just
to add missing annotations. In a few cases, some SFINAE methods are
changed not to use pointers at all. In some cases, like
cord_internal.h, I removed the single annotation as that is easier
than doing the entire complicated file for now. cordz_test_helpers.h
uses GoogleTest macros, which bring in pointers that can't easily be
annotated, so I removed the annotations from this file as well.
Tests are also opted-out of the warning.
I'm not sure why the x86 Clang version didn't pick these issues up.
PiperOrigin-RevId: 755844859
Change-Id: I7d7f4cc4f6d779f52c86a4d96e07880341244491
absl::Nonnull -> absl_nonnull, absl::Nullable -> absl_nullable, and absl::NullabilityUnknown -> absl_nullability_unknown. The new macros are positioned as a qualifier on the affected type, similar to const, rather than as a templated
type wrapping the affected type.
PiperOrigin-RevId: 747888537
Change-Id: Ibd4d3596214a7825fe8c90490f1c988568ec1787
Manual annotation of these APIs specifically helps us avoid inferring them with tooling as having conflicted nullability due to a small number of incorrect uses out of many, many uses.
These annotations have no runtime impact.
PiperOrigin-RevId: 739258146
Change-Id: Id18bd1f0313c5b196e1d9e8ed4d1ce057dfcd582
'S' should be replace with S, in DO_NOT_$UBMIT :-)
`DO_NOT_$UBMIT` is an alias for `ERROR`, and is the right level to use
when you are using `LOG` for what's often called `printf()` debugging.
The name is easy to spot in review and is caught by common (but not
on-by-default) presubmit checks.
The contract is that **it must not be checked in**, so the Abseil team
reserves the right to delete it, change what it does, and/or scrub any
instances that do end up checked in, with or without notice.
Git users could consider adding a pre-commit hook to reject
the string "DO_NOT_$UBMIT" to use this feature.
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
PiperOrigin-RevId: 738364247
Change-Id: I3a277a941e7735ebf64b8da641bd42ca4830df9c
In this change, //absl/status is intentionally excluded because of
complication with SWIG compatibility. This may be handled separately.
PiperOrigin-RevId: 731387819
Change-Id: I71bf2e02f3a477d65575d467f5e5ab163846d31e
referenced after it is destroyed. While the string does live until the end of
the full statement, logging (previously occurred) in the destructor of the
`LogMessage` which may be constructed before the temporary string (and thus
destroyed after the temporary string's destructor).
This change moves logging to occur inside the internal `Voidify`. This does not
affect when logging occurs relative to any other observable, other than the
fact that it runs later than any temporary destructors in the log statement.
PiperOrigin-RevId: 729708145
Change-Id: I9b90367d7a5f4ed3cf091d4d33756262acc03ec6
Always define it as `1`. CTAD is a C++17 feature, and Abseil does not support older versions of the language.
PiperOrigin-RevId: 729144923
Change-Id: I13572569004d7f0b56a2c11f264b7a3de15927b9