public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49331] New: Accepts invalid specification expressions
@ 2011-06-08 21:09 burnus at gcc dot gnu.org
  2011-06-09  8:17 ` [Bug fortran/49331] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-06-08 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Accepts invalid specification expressions
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


gfortran currently compiles http://www.fortran.com/iso_varying_string.f95 with
-std=f2003 without any error.

Expected: gfortran rejects the program with an error messages.


Crayftn correctly rejects the program with:

      character(LEN=len(string))       :: char_string
                    ^
ftn-355 crayftn: ERROR CHAR_AUTO, File = iso_varying_string.f90, Line =
861, Column = 19
    Generic interface "LEN" is referenced in a declarative expression in
a [sub]module.  Specific "LEN_" must be completely specified prior to
being referenced.


The function being use is the innocently looking:

    pure function char_auto (string) result (char_string)
      type(varying_string), intent(in) :: string
      character(LEN=len(string))       :: char_string

However, the specific function to which then LEN() resolves is not the
intrinsic LEN, but the specific function LEN_, which is defined in the same
module - but (crucially!) later than the function char_auto, which uses it.
That's invalid!


For a shorter example, see interpretation request J3/11-101, F08/0050, which
passed already J3 and will be voted on soon by WG5. Cf.
http://j3-fortran.org/doc/year/11/11-101r1.txt
(Note: If the file is edited, the revision number is incremented, please
remember to check whether there is, e.g., a 11-101r2.txt.)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-18  2:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08 21:09 [Bug fortran/49331] New: Accepts invalid specification expressions burnus at gcc dot gnu.org
2011-06-09  8:17 ` [Bug fortran/49331] " burnus at gcc dot gnu.org
2014-03-22 19:52 ` dominiq at lps dot ens.fr
2021-12-18  2:41 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).