[clang] [clang] Fix -Wdouble-promotion in C++ list-initialization (PR #159992)

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 24 08:32:46 PDT 2025


================
@@ -12797,6 +12797,22 @@ static void CheckCommaOperand(
     S.CheckImplicitConversion(E, T, CC);
 }
 
+static Expr *IgnoreExplicitCastForImplicitConversionCheck(ExplicitCastExpr *E) {
----------------
Sirraide wrote:

> `double{{f}}` seems to be invalid syntax

If we don’t error on it it’s not really ‘invalid’ (even if the standard doesn’t allow it), so we should still test that.

> running with -Wno-many-braces-around-scalar-init i suppose?

I’d just add an `expected-warning` comment for that one in this case.

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


More information about the cfe-commits mailing list