[all-commits] [llvm/llvm-project] 81eda0: [libc++] Extract __clamp_to_integral to its own he...

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed Dec 8 05:33:49 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 81eda008e952e6b46d20b97f7fbfd6f2e69bd3a1
      https://github.com/llvm/llvm-project/commit/81eda008e952e6b46d20b97f7fbfd6f2e69bd3a1
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2021-12-08 (Wed, 08 Dec 2021)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    A libcxx/include/__random/clamp_to_integral.h
    M libcxx/include/__random/poisson_distribution.h
    M libcxx/include/cmath
    M libcxx/include/module.modulemap
    M libcxx/include/random
    A libcxx/test/libcxx/diagnostics/detail.headers/random/clamp_to_integral.module.verify.cpp
    M libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp

  Log Message:
  -----------
  [libc++] Extract __clamp_to_integral to its own header

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.

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




More information about the All-commits mailing list