================
@@ -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];
----------------
hubert-reinterpretcast wrote:

> IMO we'd probably want to introduce the concept of "constexpr since C++xy".

@philnik777, are you envisioning something where `LangOptions` are passed into 
`Builtin::Context::isConstantEvaluated`?
https://github.com/llvm/llvm-project/blob/fb2c6597e39e9e1a775525ea0236b2f89e46acff/clang/include/clang/Basic/Builtins.h#L279

I think the existing `Constexpr`/"`E`" attribute can be left alone for use in 
"always `constexpr`" cases.

For the selectively-`constexpr` cases, `LibBuiltin` in 
`clang/include/clang/Basic/BuiltinsBase.td` should have 
`OnlyBuiltinPrefixedAliasIsConstexpr` renamed to 
`BuiltinPrefixedAliasIsConstexpr`. Then adding a new string property for 
`UnprefixedOnlyConstexprSince` makes sense to me. It can be encoded into 
`Builtin::Info` (and I think using the `LangFeatures` enumeration from 
`"clang/Basic/LangStandard.h"` is not terribly wrong).


https://github.com/llvm/llvm-project/pull/88978
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to