[clang] [Clang] Add constexpr eval for cmath builtins (PR #194327)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Fri May 22 12:03:56 PDT 2026
================
@@ -199,6 +199,25 @@ static llvm::APSInt convertBoolVectorToInt(const Pointer &Val) {
return Result;
}
+static bool CheckFloatResult(InterpState &S, CodePtr OpPC,
+ const APFloat &Result, APFloat::opStatus Status) {
+ if (S.inConstantContext())
+ return true;
+
----------------
hubert-reinterpretcast wrote:
It seems to me that the whole point of the function is to produce error messages when the resulting status means that the expression is not a valid constant expression when it needs to be one. The function would not generate any error messages when the early return is taken. It would surprise me greatly if there was no requirement for the expression to be a valid constant expression when `S.inConstantContext()` is true.
https://github.com/llvm/llvm-project/pull/194327
More information about the cfe-commits
mailing list