================
@@ -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) {
----------------
MitalAshok wrote:

Because it has a different specification from narrowing conversions 
(<https://wg21.link/expr.const#13.9> vs <https://wg21.link/dcl.init.list#7.2>), 
so we need stuff specific for converted constant expressions. E.g., 
`float{__FLT_DENORM_MIN__ / 4.0}` is not a narrowing conversion even though it 
rounds the double value to `0.0f`, but it shouldn't be a converted constant 
expression.

Theoretically we should only be calling `getNarrowingKind` when `SCS->Second == 
ICK_Integral_Conversion` (I think we also use it for boolean conversions 
[CWG1407](https://cplusplus.github.io/CWG/issues/1407.html)).

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

Reply via email to