[Bug fortran/46982] SIZE(TRANSFER()) as specification expression

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Sun Jun 23 22:08:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46982

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gmx dot de

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Dominique d'Humieres from comment #2)
> Still present at revision 200321. Is the test in comment #0 valid or not?

Probably a case where the standard is not intuitive:

  size(transfer(something_type(),(/0/)))

is a constant expression, but

  size(transfer(something,(/0/)))

apparently is not, simply because "something" is not constant.
IMO it also appears not to qualify as a specification expression.

Replacing

  type(something_type),save :: something

by

  type(something_type),parameter :: something = something_type()

would change something into a constant and make the code compile.

So I think that the code in comment #0 is not legal.



More information about the Gcc-bugs mailing list