On Thu, Jan 16, 2020 at 11:34:43PM +0100, Thomas Koenig wrote:
> diff --git a/gcc/testsuite/gfortran.dg/function_reference_1.f90
> b/gcc/testsuite/gfortran.dg/function_reference_1.f90
> new file mode 100644
> index 00000000000..78c92a6f20d
> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/function_reference_1.f90
> @@ -0,0 +1,11 @@
> +! { dg-do compile }
> +! PR 44960 - this was erroneusly accepted.
> +! Original test case by Daniel Franke.
> +
> +type t
> + integer :: a
> +end type t
> +type(t) :: foo
> +print *, foo(1)%a ! { dg-error "Function call can not contain a reference" }
> +end
> +
I do not understand this error message, and find it to be confusing.
foo(1)%a looks like an invalid array reference. That is, foo is scalar
and foo(1) is an array element.
PS: s/can not/cannot
--
Steve