[PATCH] D157072: [clang][ExprConst] Check float operation input for signaling NaNs

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 3 23:28:05 PDT 2023


tbaeder created this revision.
tbaeder added reviewers: jcranmer-intel, clang.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Split out from https://reviews.llvm.org/D156506.

Before adding this behavior to the new constexpr interpreter, I'd like to first see it in the current one.

This patch removes the checks for a NaN result of floating point operations and instead checks the input operands for signaling NaNs.

There are only three tests for the NaN-result check as far as I can see, so I added a few new ones.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157072

Files:
  clang/include/clang/Basic/DiagnosticASTKinds.td
  clang/lib/AST/ExprConstant.cpp
  clang/test/CXX/expr/expr.const/p2-0x.cpp
  clang/test/SemaCXX/constexpr-float.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157072.547108.patch
Type: text/x-patch
Size: 4875 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230804/0d71a510/attachment-0001.bin>


More information about the cfe-commits mailing list