[libcxx-commits] [PATCH] D115282: [libc++] Extract __clamp_to_integral to its own header

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 7 13:42:37 PST 2021


ldionne created this revision.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

In addition to being more consistent with our approach for helpers, this
solves an actual issue where <cmath> was using numeric_limits but never
including the <limits> header directly. In a normal setup, this is not
an issue because the <math.h> header included by <cmath> does include
<limits>. However, I did stumble upon some code where that didn't work,
most likely because they were placing their own <math.h> header in front
of ours. I didn't bother investigating further.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115282

Files:
  libcxx/include/__numeric/clamp_to_integral.h
  libcxx/include/__random/poisson_distribution.h
  libcxx/include/cmath
  libcxx/include/module.modulemap
  libcxx/test/libcxx/diagnostics/detail.headers/numeric/clamp_to_integral.module.verify.cpp
  libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115282.392522.patch
Type: text/x-patch
Size: 6953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211207/7d083047/attachment-0001.bin>


More information about the libcxx-commits mailing list