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

            Bug ID: 60144
           Summary: Misleading error message when missing "then" after
                    "if" and "else if"
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: loximann at gmail dot com

Compiler version:
GNU Fortran (Ubuntu 20130917-1ubuntu1) 4.9.0 20130917 (experimental) [trunk
revision 202647]

Test program:
--------------------
program ifelif
    if (.TRUE.)
    else if (.FALSE.)
    end if
end program
--------------------

Error messages:
----------------------
if.F90:2.15:

    if (.TRUE.)
               1
Error: Cannot assign to a named constant at (1)
if.F90:3.11:

    else if (.FALSE.)
           1
Error: Unexpected junk after ELSE statement at (1)
[...]
----------------------

Both errors should read something like "Missing THEN after IF/ELSE IF".

The first error message doesn't even make sense...

Reply via email to