[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-07 Thread Haocong Lu via cfe-commits
https://github.com/Luhaocong closed https://github.com/llvm/llvm-project/pull/74439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-04 Thread Haocong Lu via cfe-commits
Luhaocong wrote: > Thanks for confirming. Do you need me to merge that for you? It can't be better, thanks. https://github.com/llvm/llvm-project/pull/74439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-04 Thread Haocong Lu via cfe-commits
Luhaocong wrote: > LGTM. > > The format diagnostics are new in Clang 18 and as such we do not need a > release note. Correct? This format diagnostics is existent until https://github.com/llvm/llvm-project/commit/04e6178ae932c9a1d939dcfe3ef1189f4bbb21aa had been committed. Clang 17.0.1 gives

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-04 Thread Haocong Lu via cfe-commits
@@ -18,3 +18,8 @@ void test_floating_promotion(__fp16 *f16, float f32, double f64) { // CHECK: ImplicitCastExpr {{.*}} 'double' // CHECK-NEXT: 'float' } + +void test_Float16_no_default_promotion(_Float16 f16) { + variadic(1, f16); +// CHECK-NOT: ImplicitCastExpr {{.*}}

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-04 Thread Haocong Lu via cfe-commits
https://github.com/Luhaocong updated https://github.com/llvm/llvm-project/pull/74439 >From e86dc461c8654b6b9806ad88bf2ba3d731c81d50 Mon Sep 17 00:00:00 2001 From: Lu Haocong Date: Tue, 5 Dec 2023 16:45:22 +0800 Subject: [PATCH] [Sema] Warning for _Float16 passed to format specifier '%f'

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-04 Thread Haocong Lu via cfe-commits
Luhaocong wrote: Thanks for everyone's review. Do you have any other suggestions for this change, and can this pull request be accepted ? https://github.com/llvm/llvm-project/pull/74439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2024-01-04 Thread Haocong Lu via cfe-commits
https://github.com/Luhaocong updated https://github.com/llvm/llvm-project/pull/74439 >From 899e18d1ca94efad41c2e09dff0a3213d7fb0f7e Mon Sep 17 00:00:00 2001 From: Lu Haocong Date: Tue, 5 Dec 2023 16:45:22 +0800 Subject: [PATCH] [Sema] Warning for _Float16 passed to format specifier '%f'

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2023-12-06 Thread Haocong Lu via cfe-commits
https://github.com/Luhaocong updated https://github.com/llvm/llvm-project/pull/74439 >From 47ec17023ebc75a61951930b77e08bb2f726775b Mon Sep 17 00:00:00 2001 From: Lu Haocong Date: Tue, 5 Dec 2023 16:45:22 +0800 Subject: [PATCH] [Sema] Warning for _Float16 passed to format specifier '%f'

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2023-12-05 Thread Haocong Lu via cfe-commits
Luhaocong wrote: > Should this only apply in C23 mode? Standard behavior until C23 is that > `_Float16` promotes to `double`. What about C++? It seems clang never support default argument promotions for _Float16, as described in

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2023-12-05 Thread Haocong Lu via cfe-commits
Luhaocong wrote: This patch improves implement https://github.com/llvm/llvm-project/commit/04e6178ae932c9a1d939dcfe3ef1189f4bbb21aa. Could you please help me review this patch @apple-fcloutier @AaronBallman https://github.com/llvm/llvm-project/pull/74439

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2023-12-05 Thread Haocong Lu via cfe-commits
https://github.com/Luhaocong updated https://github.com/llvm/llvm-project/pull/74439 >From afb0d3909cde31cf73e2baf3efd13d584943704f Mon Sep 17 00:00:00 2001 From: Lu Haocong Date: Tue, 5 Dec 2023 16:45:22 +0800 Subject: [PATCH] [Sema] Warning for _Float16 passed to format specifier '%f'

[clang] [Sema] Warning for _Float16 passed to format specifier '%f' (PR #74439)

2023-12-05 Thread Haocong Lu via cfe-commits
https://github.com/Luhaocong created https://github.com/llvm/llvm-project/pull/74439 According to https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2844.pdf, default argument promotions for _FloatN types has been removed. A warning is needed to notice user to promote _Float16 to double