[libc++] Add [[nodiscard]] extensions in <math.h>
authorNikolas Klauser <nikolasklauser@berlin.de>
Sun, 25 Dec 2022 19:13:39 +0000 (20:13 +0100)
committerNikolas Klauser <nikolasklauser@berlin.de>
Thu, 12 Jan 2023 17:34:49 +0000 (18:34 +0100)
commit633927db844e47c87dd93198e2c2763dd10f668f
treef3a1c352e33b258b2b186c8c39849e73f0d159f3
parentd808ad822a5b49594d5a4955d4d9b3a59a50d360
[libc++] Add [[nodiscard]] extensions in <math.h>

There are quite a few functions marked `[[gnu::const]]` inside the compiler. This patch adds `[[nodiscard]]` to libc++-provided overloads of these functions to match the diagnostics produced.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D140855
libcxx/docs/UsingLibcxx.rst
libcxx/include/math.h
libcxx/include/stdlib.h
libcxx/test/libcxx/diagnostics/math_nodiscard_extensions.verify.cpp [new file with mode: 0644]