This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32386] Pure function not allowed in specification expression
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jun 2007 22:49:37 -0000
- Subject: [Bug fortran/32386] Pure function not allowed in specification expression
- References: <bug-32386-6246@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from pault at gcc dot gnu dot org 2007-06-18 22:49 -------
John,
5.1
.....many snips.....
....If a specification-expr involves a reference to a specification function
(7.1.6.2), the expression is considered to be a nonconstant expression. If the
data object being declared depends on the value of such a nonconstant
expression and is not a dummy argument, such an object is called an automatic
data object.
I can see why you should think that this is OK. However, this section of the
standard says otherwise. In fact, there is a practical consideration, which
probably drives the standard:
This character length cannot be computed at compilation time because the
specification function is needed. Automatic objects in procedures have their
variable properties calculated in the interface, which is not available for the
main program. Thus, even were this legal code, I would not have the slightest
idea how to implement it.
My vote is that this is invalid.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32386