https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85896

--- Comment #4 from G. Steinmetz <gs...@t-online.de> ---
(In reply to Thomas Koenig from comment #3)
> What is the expected output?  Does this declare a new variable "min"
> or "max", or should the result simply be 'c' (or 'b')?

As it makes not much sense (IMO) to "specialise" a generic intrinsic via
user provided declaration, it looks more like a type conflict / error.


But following example is accepted, character is not matching intrinsic sin :

$ cat z4.f90
program p
   character :: sin
   print *, sin(1.0)
end

$ gfortran-9-20181028 -Wall -Wextra -fcheck=all z4.f90
$ a.out
  0.841470957


On the other hand :

$ cat z5.f90
program p
   character :: sin = 'c'
   print *, sin(1.0)
end

$ gfortran-9-20181028 z5.f90
z5.f90:2:19:

    2 |    character :: sin = 'c'
      |                   1
Error: Function 'sin' at (1) cannot have an initializer
z5.f90:2:19:

    2 |    character :: sin = 'c'
      |                   1
Error: 'sin' at (1) is not a VALUE


$ cat z5b.f90
program p
   character :: sin
   print *, sin(1.0)
   sin = 'c'
   print *, sin
end

$ gfortran-9-20181028 z5b.f90
z5b.f90:4:6:

    4 |    sin = 'c'
      |      1
Error: 'sin' at (1) is not a variable
z5b.f90:5:15:

    5 |    print *, sin
      |               1
Error: Function 'sin' requires an argument list at (1)

Reply via email to