[all-commits] [llvm/llvm-project] e0441d: [libc++][chono] Use hidden friends for leap_second...

Mark de Wever via All-commits all-commits at lists.llvm.org
Tue Aug 20 10:13:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e0441d587b3c5c5d11b08cbcfbbbb66ea8185510
      https://github.com/llvm/llvm-project/commit/e0441d587b3c5c5d11b08cbcfbbbb66ea8185510
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2024-08-20 (Tue, 20 Aug 2024)

  Changed paths:
    M libcxx/docs/Status/Cxx2cIssues.csv
    M libcxx/include/__chrono/leap_second.h

  Log Message:
  -----------
  [libc++][chono] Use hidden friends for leap_second comparison. (#104713)

The function

    template<class Duration>
requires three_way_comparable_with<sys_seconds, sys_time<Duration>>
constexpr auto operator<=>(const leap_second& x, const
sys_time<Duration>& y) noexcept;

Has a recursive constrained. This caused an infinite loop in GCC and is
now hit by https://github.com/llvm/llvm-project/pull/102857.

A fix would be to make this function a hidden friend, this solution is
propsed in LWG4139.

For consistency all comparisons are made hidden friends. Since the issue
causes compilation failures no additional test are needed.

Fixes: https://github.com/llvm/llvm-project/issues/104700



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list