[all-commits] [llvm/llvm-project] 03ee46: [libc++] Consistently unparenthesize `numeric_limi...

Quuxplusone via All-commits all-commits at lists.llvm.org
Fri Nov 27 14:29:28 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 03ee46127621934c030d37f50aaefdef6bf9d4b0
      https://github.com/llvm/llvm-project/commit/03ee46127621934c030d37f50aaefdef6bf9d4b0
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2020-11-27 (Fri, 27 Nov 2020)

  Changed paths:
    M libcxx/include/charconv
    M libcxx/include/span

  Log Message:
  -----------
  [libc++] Consistently unparenthesize `numeric_limits<T>::max`. NFCI.

I think people were sometimes parenthesizing `(foo::max)()` out of
misplaced concern that an unparenthesized `foo::max()` would trip up
Windows' `max(a,b)` macro. However, this is not the case: `max(a,b)`
should be tripped up only by an unparenthesized call to `foo::max(a,b)`,
and in fact we already do `_VSTD::max(a,b)` all over the place anyway
without any guards.

However, in order to do it without guards, we must also
wrap the header in _LIBCPP_PUSH_MACROS, which <span> was not.

Differential Revision: https://reviews.llvm.org/D92240




More information about the All-commits mailing list