[clang] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)

Chaitanya Koparkar via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 13 08:14:45 PDT 2025


================
@@ -199,7 +199,7 @@ def FloorF16F128 : Builtin, F16F128MathTemplate {
 
 def FmaF16F128 : Builtin, F16F128MathTemplate {
   let Spellings = ["__builtin_fma"];
-  let Attributes = [FunctionWithBuiltinPrefix, NoThrow, ConstIgnoringErrnoAndExceptions];
+  let Attributes = [FunctionWithBuiltinPrefix, NoThrow, ConstIgnoringErrnoAndExceptions, Constexpr];
----------------
ckoparkar wrote:

I needed to make the _other_ `fma` builtin constexpr, d'oh.

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


More information about the cfe-commits mailing list