Re: [PATCH] fortran: allow character in conditional expression

2025-09-19 Thread Yuao Ma
Hi Tobias, On Tue, Sep 16, 2025 at 5:11 PM Tobias Burnus wrote: > PS: Already with the current code, we may run into the issue of passing > an actual argument like '(cond ? "abc" : "cdfg")' to 'class(*)' – and I > am not sure whether we handle this correctly or not. That is a great test case, an

Re: [PATCH] fortran: allow character in conditional expression

2025-09-18 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: On Tue, Sep 16, 2025 at 5:11 PM Tobias Burnus wrote: PS: Already with the current code, we may run into the issue of passing an actual argument like '(cond ? "abc" : "cdfg")' to 'class(*)' – and I am not sure whether we handle this correctly or not. That is a great test

Re: [PATCH] fortran: allow character in conditional expression

2025-09-17 Thread Yuao Ma
Hi Tobias, On Wed, Sep 17, 2025 at 3:33 AM Tobias Burnus wrote: > > Hi Yuao, > > Yuao Ma wrote: > > On Tue, Sep 16, 2025 at 5:11 PM Tobias Burnus wrote: > > PS: Already with the current code, we may run into the issue of passing > an actual argument like '(cond ? "abc" : "cdfg")' to 'class(*)' –

Re: [PATCH] fortran: allow character in conditional expression

2025-09-16 Thread Tobias Burnus
Hi Yuao, Tobias Burnus wrote: For BT_DERIVED: (i) The type needs to be the same – or compatible ('SEQUENCE' attribute) I was referring to: "7.5.2.4 Determination of derived types": "Data entities also have the same type if they are declared with reference to different derived-type definition

[PATCH] fortran: allow character in conditional expression

2025-09-15 Thread Yuao Ma
Hi all, The first cond-expr patch has been committed as r16-3848-gaf53cfeb8352b1. This patch inspired me to work on an even clearer feature: allowing cond-expr to use characters. The change is small; we just need to conditionally fill the string_length. I'd like to implement this before moving on

Re: [PATCH] fortran: allow character in conditional expression

2025-09-15 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: The first cond-expr patch has been committed as r16-3848-gaf53cfeb8352b1. This patch inspired me to work on an even clearer feature: allowing cond-expr to use characters. The change is small; we just need to conditionally fill the string_length. ... Maybe OK for trunk?