Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-08 Thread Tobias Burnus
Yuao Ma wrote: And the latter does not handle EXPR_CONDITIONAL. Thanks for the tip! It turns out that not only does gfc_traverse_expr fail to handle conditional expressions, but check_restricted and gfc_check_init_expr don't either. I've added all the necessary fixes, and the test case is now in

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-06 Thread Yuao Ma
Hi Tobias, On Fri, Sep 5, 2025 at 11:57 PM Tobias Burnus wrote: > > Hi Yuao, > > Yuao Ma wrote: > > This time I use git format-patch. Hopefully fix the issue. > > Seem so :-) > > Do I read you patch correctly that you still want to improve it > before committing the first version? I assume so bec

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-05 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: This time I use git format-patch. Hopefully fix the issue. Seem so :-) Do I read you patch correctly that you still want to improve it before committing the first version? I assume so because the changelog part of the patch is largely lacking (except for the summary li

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-03 Thread Yuao Ma
Hi Tobias, On Tue, Sep 2, 2025 at 4:57 PM Tobias Burnus wrote: > BTW: I notice '(Stripping trailing CRs from patch; use --binary to disable.)' > when applying the patch. - Spurious '\r' in committed patches should be > avoided, albeit testcases with '\r\n' are fine as we also need to support > th

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-03 Thread Yuao Ma
On Mon, Sep 1, 2025 at 6:58 PM Tobias Burnus wrote: > > Yuao Ma wrote: > > BTW, The current trunk seems to have some problems with diagnostic > > location: https://godbolt.org/z/bcrvn9xo4 > > In the last days, there were some diagnostic changes; possibly > those caused an intermittent issue? > > O

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-03 Thread Tobias Burnus
Hi Yuao, Tobias Burnus wrote: Based on our previous discussion, we don't need to necessarily handle this in the current patch; I just wanted to highlight it. I will investigate how the argument-passing logic works. Yes, as long as there is a 'sorry' instead of producing wrong code, it is fine.

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-02 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: Hi Tobias, I have some updates about this patch. First, some good news: 1. The patch has been bootstrapped and tested with no regressions. This was achieved by limiting the type with only one 'sorry' case. 2. The frontend parsing now considers outer parentheses. :-)

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-01 Thread Tobias Burnus
Hi all, hi Yuao, Yuao Ma wrote: I mostly agree it looks okay. While I'm not that meticulous about diagnostics, I believe it should point to the '=' sign or the first character of the expression. Pointing to the middle, however, seems a bit odd. Looking at your patch, I understand what you mean

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-01 Thread Tobias Burnus
Yuao Ma wrote: BTW, The current trunk seems to have some problems with diagnostic location: https://godbolt.org/z/bcrvn9xo4 In the last days, there were some diagnostic changes; possibly those caused an intermittent issue? Otherwise, it looks ok. Namely: The '1' points to the space after '='i

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-08-30 Thread Yuao Ma
On Sat, Aug 30, 2025 at 2:02 AM Yuao Ma wrote: > 2. The diagnostic location appears to have an off-by-one error. > Consider the diagnostic for conditional_4.f90. Ideally, I'd like > points (1) and (2) to reference the true_expr and false_expr, > respectively. However, the current output is odd: (1

[PATCH] fortran: implement conditional expression for fortran 2023

2025-08-29 Thread Yuao Ma
Hi Tobias, I have some updates about this patch. First, some good news: 1. The patch has been bootstrapped and tested with no regressions. This was achieved by limiting the type with only one 'sorry' case. 2. The frontend parsing now considers outer parentheses. And we also have some unresolved

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-08-26 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: I addressed some review comments and included additional feedback. Thanks for the update. I know that the patch is incomplete, but as I started with bootstrapping, I start with the following. I bet the issues are known to you: First, your patch does not bootstrap* h

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-08-25 Thread Yuao Ma
Hi Tobias, I addressed some review comments and included additional feedback. On 8/22/2025 11:22 PM, Tobias Burnus wrote: Hi Yuao, Yuao Ma wrote: Hi Paul, On 7/31/2025 6:02 AM, Paul Richard Thomas wrote: That's exactly how I had a mind to do it. You beat me to it 🙁 Just get on, polish the

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-08-22 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: Hi Paul, On 7/31/2025 6:02 AM, Paul Richard Thomas wrote: That's exactly how I had a mind to do it. You beat me to it 🙁 Just get on, polish the patch and add more tests. I've updated the patch with improvements to both the functionality and test cases. It should now

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-08-03 Thread Yuao Ma
Hi Paul, On 7/31/2025 6:02 AM, Paul Richard Thomas wrote: That's exactly how I had a mind to do it. You beat me to it :-( Just get on, polish the patch and add more tests. I've updated the patch with improvements to both the functionality and test cases. It should now work well for simple sc

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-07-30 Thread Paul Richard Thomas
Hi Yuao, That's exactly how I had a mind to do it. You beat me to it :-( Just get on, polish the patch and add more tests. Thanks Paul On Wed, 30 Jul 2025 at 15:53, Yuao Ma wrote: > Hi all, > > This patch introduces support for conditional expressions (also known as > ternary operators in s

[PATCH] fortran: implement conditional expression for fortran 2023

2025-07-30 Thread Yuao Ma
. Please take a look when you have a moment. Thanks in advance, YuaoFrom 8b0312442ade17f64ae7c8059daa3af46a0bceda Mon Sep 17 00:00:00 2001 From: Yuao Ma Date: Wed, 30 Jul 2025 22:38:57 +0800 Subject: [PATCH] fortran: implement conditional expression for fortran 2023 TBD gcc/fortran/ChangeLog: