https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123961
Bug ID: 123961
Summary: Incorrect overloaded procedure called
Product: gcc
Version: 13.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: townsend at astro dot wisc.edu
Target Milestone: ---
Created attachment 63579
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63579&action=edit
Code that demonstrates the issue
Compiling the attached code on 13.4.0 (MacOS/Apple Silicon), I get the
following error:
test_overload.f90:39:17:
39 | print *, size(foo_t([1,2,3]))
| 1
Error: 'array' argument of 'size' intrinsic at (1) must be an array
If I change the foo_t() call to foo_t_1_(), the error goes away. This suggests
that the incorrect procedure is being called through the foo_t() generic.
The error also goes away if I change the return types of the foo_t_0_ and
foo_t_1_ functions from class(foo_t) to type(foo_t).