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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
(In reply to Sergio Losilla from comment #0)
> 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...


How is the compiler suppose to know that the programmer may have
meant

   program ifelif
   if (.TRUE.) i = 42
   if (.FALSE.) then
      j = 42
   end if
   end program

As for the message that you think makes no sense, I suspect
the parse has identified (.TRUE.) as a malformed expression.

Reply via email to