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

2025-10-18 Thread Marcel Jacobse via cfe-commits
@@ -12797,6 +12797,22 @@ static void CheckCommaOperand( S.CheckImplicitConversion(E, T, CC); } +static Expr *IgnoreExplicitCastForImplicitConversionCheck(ExplicitCastExpr *E) { mjacobse wrote: Added as suggested. Let me know if you'd like to see any more

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

2025-10-18 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse updated https://github.com/llvm/llvm-project/pull/159992 >From 4f63f703b5bb56d2def94b99cd05212652605e42 Mon Sep 17 00:00:00 2001 From: mjacobse <[email protected]> Date: Sun, 21 Sep 2025 18:06:20 +0200 Subject: [PATCH 01/12] [clang] Fix -Wdoub

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

2025-09-24 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse edited https://github.com/llvm/llvm-project/pull/159992 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-09-24 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse updated https://github.com/llvm/llvm-project/pull/159992 >From 4f63f703b5bb56d2def94b99cd05212652605e42 Mon Sep 17 00:00:00 2001 From: mjacobse <[email protected]> Date: Sun, 21 Sep 2025 18:06:20 +0200 Subject: [PATCH 01/13] [clang] Fix -Wdoub

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

2025-09-22 Thread Marcel Jacobse via cfe-commits
mjacobse wrote: Yeah that makes sense to me. So I reverted this attempt of just checking if we are in some kind of ListInit, it does not work. It looks like expressions like `double{f}` turn into a `CXXFunctionalCastExpr` just like `double(f)`, with the only difference that for `double{f}` the

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

2025-09-22 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse updated https://github.com/llvm/llvm-project/pull/159992 >From 4f63f703b5bb56d2def94b99cd05212652605e42 Mon Sep 17 00:00:00 2001 From: mjacobse <[email protected]> Date: Sun, 21 Sep 2025 18:06:20 +0200 Subject: [PATCH 1/7] [clang] Fix -Wdouble

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

2025-09-21 Thread Marcel Jacobse via cfe-commits
mjacobse wrote: Thanks, your `struct B` example raises a very good point, because with this PR no warning would be thrown anymore for the promotion of `f` to `double` in the initialization of member `B::d`. Using parantheses ```c++ B(float f) : d(f) {} ``` would bring back the warning. Somethin

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

2025-09-21 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse created https://github.com/llvm/llvm-project/pull/159992 Resolves https://github.com/llvm/llvm-project/issues/33409. The information `IsListInit` is already passed to function `CheckImplicitConversion` for another use-case which makes adding a condition for the dou