This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32386] Pure function not allowed in specification expression



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]