This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/58307] Bogus error 'Function requires an argument list'
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Sep 2013 19:34:36 +0000
- Subject: [Bug fortran/58307] Bogus error 'Function requires an argument list'
- Auto-submitted: auto-generated
- References: <bug-58307-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58307
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to janus from comment #0)
> produces (with 4.7, 4.8 and trunk) the error message
>
> real(point) :: this
> 1
> Error: Function 'point' requires an argument list at (1)
>
> which is misleading, since 'point' is obviously not a function.
Well, in this case it isn't. However, it is permitted to have a function with
the same generic name as a derived type ("constructors"). That wouldn't help in
this case as one needs a constant/initialization expression, but it explains
the error message.
(Internally, gfortran generates a generic function symbol under the
derived-type name - and links the hidden symbol with the derived type to it.)
As always, providing a good error message in all cases is difficult - the other
error message is also not that friendly as earlier gfortrans show.
pathf95/crayftn have:
This use of derived type "POINT" is not valid.
g95 has:
Error: Syntax error in structure constructor at (1)
pgf95 has:
PGF90-S-0087-Non-constant expression where constant expression required
PGF90-S-0081-Illegal selector - KIND parameter has unknown value for data
type
ifort has:
A kind type parameter must be a compile-time constant.