[clang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

Nikolas Klauser via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 01:11:25 PDT 2024


================
@@ -3452,9 +3452,10 @@ def Fmod : FPMathTemplate, LibBuiltin<"math.h"> {
 
 def Frexp : FPMathTemplate, LibBuiltin<"math.h"> {
   let Spellings = ["frexp"];
-  let Attributes = [NoThrow];
+  let Attributes = [NoThrow, Constexpr];
----------------
philnik777 wrote:

This also influences `__has_constexpr_builtin(fmin)`, which would return true but then fail to actually evaluate during a constant expression, which doesn't seem that great. IMO we'd probably want to introduce the concept of "constexpr since C++xy".

https://github.com/llvm/llvm-project/pull/88978


More information about the llvm-commits mailing list