<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/88664>88664</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Build fails on mac os 10.14 due to not including cmath
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Zentrik
      </td>
    </tr>
</table>

<pre>
    Building https://github.com/llvm/llvm-project/blob/5927492e8e68c1ee5a0d84cf6c402a900aac4a3c/clang-tools-extra/clang-tidy/modernize/UseStdNumbersCheck.cpp#L46 throws error
```
/workspace/srcdir/llvm-project/clang-tools-extra/clang-tidy/modernize/UseStdNumbersCheck.cpp:46:10: error: call to 'abs' is ambiguous
--
return std::abs(Node.getValueAsApproximateDouble() - Value) < DiffThreshold;
 ^~~~~~~~
/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/stdlib.h:132:6: note: candidate function
int      abs(int) __pure2;
 ^
/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/stdlib.h:111:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long      abs( long __x) _NOEXCEPT {return  labs(__x);}
 ^
/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/usr/include/c++/v1/stdlib.h:113:44: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
```

Based on the sdks here https://github.com/joseluisq/macosx-sdks, it seems mac os 11.0 was the first to add `std::abs(double)` to `cstdlib` (which is currently included in the file).
To fix for earlier mac os versions including `cmath` should work.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElVFv6yYUxz8NeUGxbLAd5yEPSVtLkaqs0u2utr1EGE5ibgl4HGjSPeyzT9jpetdp1Sbd6VqWHQgczv-H-R-BqI8WYEWqDaluZ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