)]}'
{
  "commit": "aa373c116ddcccd6bfed1ecc26840b5d0f892633",
  "tree": "4b5aa25904ee0b32ef964e4968e4069f9aa40eba",
  "parents": [
    "5d576eb1655e86aa868ff3a357455c7a74acafe8"
  ],
  "author": {
    "name": "Mohamed Ahmed Fouad Youssef",
    "email": "88937815+moelomda@users.noreply.github.com",
    "time": "Tue Nov 17 08:03:48 2026 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Tue Nov 17 09:25:16 2026 -0800"
  },
  "message": "PR #2536: Fix bit_width return type with older libstdc++\n\nImported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2536\n\nWith libstdc++ before version 13, C++20\u0027s `std::bit_width` returns the unsigned input type instead of `int`. Importing it makes `absl::bit_width` change return type between C++17 and C++20, and the existing `UnsignedIntegerTypesTest.ReturnTypes` assertions fail.\n\nUse Abseil\u0027s existing `bit_width` implementation on those libstdc++ versions. Keep `std::bit_ceil`, `std::bit_floor`, and `std::has_single_bit` in use, and retain the standard `bit_width` alias on unaffected libraries. This follows the existing workaround for older libc++ rotation signatures.\n\nFixes #1890.\n\nValidation on Ubuntu 22.04 with GCC/libstdc++ 11.4, CMake 3.22.1, and GoogleTest v1.17.0:\n\n- Before the fix, compiling the existing `bits_test.cc` in C++20 fails its four return-type assertions; C++17 passes. No duplicate regression test was added.\n- Configured Release builds with `ABSL_BUILD_TESTING\u003dON` and `CMAKE_CXX_STANDARD\u003d17` and `20`; built `absl_bits_test` and `absl_int128_test` with their dependencies. Both CTest targets pass in each mode: 22 bit-operation tests and 92 int128 tests per mode.\n- A standalone consumer\u0027s return-type and constexpr-value assertions pass in both modes with `-Wall -Wextra -Werror -pedantic`.\n- Changed-line clang-format 18.1.8 check and `git diff --check` pass.\n\nThe [GCC 12.5](https://github.com/gcc-mirror/gcc/blob/releases/gcc-12.5.0/libstdc%2B%2B-v3/include/std/bit) and [GCC 13.1](https://github.com/gcc-mirror/gcc/blob/releases/gcc-13.1.0/libstdc%2B%2B-v3/include/std/bit) release headers confirm the version boundary. The full Abseil suite and other compiler, standard-library, and platform combinations were not run locally. Investigation, implementation, and validation used Codex assistance.\nMerge 93faa1f60c7f1773439e0b68eb7109a4d98233d6 into 80264aff67d041e1a4ca7f4fd123079ff99c975e\n\nMerging this change closes #2536\n\nPiperOrigin-RevId: 1023745353\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8eca3927ffdf8f03b3ca718dfa292ec027c6b53c",
      "old_mode": 33188,
      "old_path": "absl/numeric/bits.h",
      "new_id": "902b2d24ebcc369f58258f1529343f0875e5b890",
      "new_mode": 33188,
      "new_path": "absl/numeric/bits.h"
    }
  ]
}
