rsmith added inline comments.

================
Comment at: clang/lib/AST/ExprConstant.cpp:2445
+       FPO.getFPExceptionMode() != LangOptions::FPE_Ignore ||
+       FPO.getAllowFEnvAccess()) && Info.Ctx.getLangOpts().CPlusPlus) {
+    Info.FFDiag(E, diag::note_constexpr_float_arithmetic_strict);
----------------
I don't think we need the `CPlusPlus` check here; we bail out of this function 
in constant contexts in all language modes, and in non-constant contexts we 
want to abort evaluation under this condition in C too.


================
Comment at: clang/lib/AST/ExprConstant.cpp:2496-2498
+  if (llvm::APFloatBase::opOK != Result.convertFromAPInt(Value,
+                                   Value.isSigned(),
+                                   APFloat::rmNearestTiesToEven) &&
----------------
Following D89360, we should skip this check if `Info.InConstantContext`.


================
Comment at: clang/lib/AST/ExprConstant.cpp:12302
+    llvm::APFloatBase::cmpResult CmpResult = LHS.compare(RHS);
+    if (CmpResult == APFloat::cmpUnordered &&
+        E->getFPFeaturesInEffect(Info.Ctx.getLangOpts()).isFPConstrained()) {
----------------
Skip this check if `Info.InConstantContext`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87528/new/

https://reviews.llvm.org/D87528

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to