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

2024-01-08 Thread Rainer Orth via cfe-commits
rorth wrote: This patch broke the [Solaris/sparcv9 buildbot](https://lab.llvm.org/buildbot/#/builders/72/builds/1709): the new/changed tests `FAIL` with ``` File /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/clang/test/SemaCXX/format-strings-scanf.cpp Line 25: _Floa

[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 https://lists.llvm.org/cgi-bin/mailman/

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

2024-01-04 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. Thanks for confirming. Do you need me to merge that for you? https://github.com/llvm/llvm-project/pull/74439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[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 {{.*}} 'doub

[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' Accord

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

2024-01-04 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM. The format diagnostics are new in Clang 18 and as such we do not need a release note. Correct? https://github.com/llvm/llvm-project/pull/74439 ___ cfe-commits mailing list cfe-commits@list

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

2024-01-04 Thread 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 {{.*}} 'doub

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

2024-01-04 Thread via cfe-commits
https://github.com/cor3ntin edited 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 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 https://l

[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' Accord

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

2023-12-20 Thread Joshua Cranmer via cfe-commits
jcranmer-intel wrote: > [N2844](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2844.pdf), as > linked by OP, references the removed language that you are looking for. Doing some more spelunking, no released version of the TS ever had default argument promotion. The change to the TS was done

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

2023-12-20 Thread via cfe-commits
apple-fcloutier wrote: [N2844](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2844.pdf), as linked by OP, references the removed language that you are looking for. As Aaron said, it doesn't matter if clang never claimed conformance/never implemented default argument promotion for these type

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

2023-12-20 Thread Joshua Cranmer via cfe-commits
jcranmer-intel wrote: > Should this only apply in C23 mode? Standard behavior until C23 is that > `_Float16` promotes to `double`. What about C++? I can't find any reference in older versions of C or TS 18661-3 that suggests that `_Float16` is promoted to `double`. The wording of 6.5.2.2 used

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

2023-12-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Should this only apply in C23 mode? Standard behavior until C23 is that > `_Float16` promotes to `double`. What about C++? `_Float16` wasn't standardized until C23; before then it was part of TS 18661, but we never claimed conformance to that (that I'm aware of), so I thi

[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' Accord

[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 https://github.com/llvm/llvm-project/blob/main/clang/docs/Langua

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

2023-12-05 Thread via cfe-commits
apple-fcloutier wrote: Should this only apply in C23 mode? Standard behavior until C23 is that `_Float16` promotes to `double`. What about C++? https://github.com/llvm/llvm-project/pull/74439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[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' Accord

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

2023-12-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haocong Lu (Luhaocong) Changes 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 expli

[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 explici