[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 01:22:40 PDT 2024


================
@@ -6229,7 +6231,37 @@ static ExprResult BuildConvertedConstantExpression(Sema &S, Expr *From,
   if (Result.isInvalid())
     return Result;
 
-  // Check for a narrowing implicit conversion.
+  if (SCS->Second == ICK_Floating_Conversion) {
----------------
Sirraide wrote:

Is there a reason all of this is here instead of in `StandardConversionSequence::getNarrowingKind()`, where we seem to be already handling most of this?

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


More information about the cfe-commits mailing list