autotidy icon indicating copy to clipboard operation
autotidy copied to clipboard

Submodule abseil-cpp @ d902eb8 implicitly includes <limits>

Open jpcoder233 opened this issue 3 years ago • 0 comments

Current Bug behavior

AUR Arch Linux package of autotidy (aptly named autotidy-git) fails compilation.

Expected Behavior

AUR Arch Linux autotidy-git installs without compilation errors.

Steps to Reproduce

  1. Upgrade current GCC to version 11
  2. Attempt to install autotidy-git (manually or AUR helper) e.g. yay -S autotidy-git
  3. Compilation will fail at abseil-cpp submodule.

Additional Information

Based upon my review of abseil-cpp submodule code base at commit d902eb8, file abseil-cpp/absl/synchronization/internal/graphcycles.cc implicitly includes <limits> resulting in compilation error at line 450.

This error only occurs for GCC versions 11 or newer, because of changes to header dependencies:

Some C++ Standard Library headers have been changed to no longer include other headers that they do need to depend on. As such, C++ programs that used standard library components without including the right headers will no longer compile.

The following headers are used less widely in libstdc++ and may need to be included explicitly when compiled with GCC 11:

  • (for std::numeric_limits)
  • (for std::unique_ptr, std::shared_ptr etc.)
  • (for std::pair, std::tuple_size, std::index_sequence etc.)
  • (for members of namespace std::this_thread.)

Luckily, newer versions of abseil-cpp fix this issue, specifically at commit 5bf048b where <limits> is explicitly included. Thus, a possible fix is to update abseil-cpp submodule to a newer version and patch autotidy-git AUR.

For now, I will directly git clone autotidy and manually build it to see if any other issues arise.

jpcoder233 avatar Jul 14 '21 06:07 jpcoder233