Following OK from Steve, with minor locus changes in access specification errors, pushed to mainline as r16-3099.
Thanks for all the help with polishing the patch up to a good state. Paul On Thu, 7 Aug 2025 at 22:02, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi Jerry et al., > > I attached an earlier version of the patch - apologies! > > Please find the latest attached. > > Paul > > > On Thu, 7 Aug 2025 at 17:07, Paul Richard Thomas < > paul.richard.tho...@gmail.com> wrote: > >> Hi Jerry, Steve and co., >> >> Thanks for the reviews. >> >> I have made extensive changes to this patch. Relative to the original >> submission, the changes are: >> (i) Cleaned up the comments in decl.cc. 'binding' removed from generic >> statement comments; >> (ii) 'generic_spec_name' used for formatted name instead of binding_name; >> (iii) Handling of access specification corrected and tidied; >> (iv) Warnings turned into errors, where appropriate; >> (v) In generic_stmt_1.f90 have added checks that specific functions are >> correctly identified; >> (vi) Also in generic_stmt_1.f90 have added DTIO and intrinsic operator >> tests; >> (vii) In generic_stmt_2.f90 have changed error messages as appropriate >> and checks on user defined and intrinsic operator errors; and >> (viii) Have added generic_stmt_3.f90, which incorporates Steve's tests >> and erroneous typing and name clashes with other entities. >> (ix) Also, the problem with the public interface for 'bak' not exposing >> the specific interfaces in 'snooze' has been resolved and is tested in >> generic_stmt_4.f90. >> >> Regtests OK. The patch adds 46 expected passes. >> >> Good for mainline? >> >> Paul >> >> >> On Mon, 4 Aug 2025 at 18:20, Jerry D <jvdelis...@gmail.com> wrote: >> >>> With your updated patch addressing Steve's comments OK. >>> >>> We have time for minor tweaks if necessary. >>> >>> On 8/3/25 11:06 AM, Steve Kargl wrote: >>> > On Sun, Aug 03, 2025 at 12:20:24PM +0100, Paul Richard Thomas wrote: >>> > >>> > First, the easy one: >>> > >>> >> + /* Match the binding name; depending on type (operator / generic) >>> format >>> >> + it for future error messages into bind_name. */ >>> > >>> > This comment looks muddled. >>> > >>> >> + if (op_type == INTERFACE_GENERIC && >>> !generic_spec->attr.generic) >>> >> + { >>> >> + gfc_error ("There's already a non-generic procedure with " >>> >> + "binding name %qs at %C", generic_spec->name); >>> >> + goto error; >>> > >>> > The contraction should probably be expanded to make >>> > translation to other languages easier. I also find >>> > the error message to be unclear for >>> > >>> > module foo >>> > implicit none >>> > private >>> > >>> > ! F2023:C815 An entity shall not be explicitly given any >>> > ! attribute more than once in a scoping unit. >>> > public bar >>> > generic, public :: bar => bah, bak >>> > >>> > contains >>> > integer function bah(i) >>> > integer, intent(in) :: i >>> > bah = i >>> > end function bah >>> > real function bak(x) >>> > real, intent(in) :: x >>> > bak = x >>> > end function bak >>> > end module foo >>> > >>> > % gfcx -c -fmax-errors=1 generic_stmt_3.F90 >>> > generic_stmt_3.F90:7:32: >>> > >>> > 7 | generic, public :: bar => bah, bak >>> > | 1 >>> > Error: There's already a non-generic procedure with binding name 'bar' >>> at (1) >>> > >>> > If you invert the statements to >>> > >>> > generic, public :: bar => bah, bak >>> > public bar >>> > >>> > % gfcx -c -fmax-errors=1 generic_stmt_3.F90 >>> > generic_stmt_3.F90:7:16: >>> > >>> > 7 | public bar >>> > | 1 >>> > Error: ACCESS specification at (1) was already specified >>> > >>> > The error is quite clear. This also generates an error >>> > >>> > public bar >>> > generic :: bar => bah, bak >>> > >>> > while >>> > >>> > generic :: bar => bah, bak >>> > public bar >>> > >>> > compiles without error. >>> > >>> >>>