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

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 22 19:45:33 PDT 2025


Sirraide wrote:

> These actually produce the `-Wdouble-promotion` warning too while they probably shouldn't.

While that is the case, I’d argue that *hopefully* no-one is using a compound literal for *`double`*. Interestingly, from looking at the AST, the fix for that, if we cared to fix that, would be the same as for this as the AST is the same, except that we have a `CompoundLiteralExpr` instead of a `CXXFunctionalCastExpr`. 

I don’t think we actually care to fix that though, so I think it’s fine to leave that as-is (maybe add a test case for it maybe to make sure we don’t crash on it).

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


More information about the cfe-commits mailing list