[patch,fortran,committed] Changed error message from "ELSE IF clause" to "IF clause" (PR29454)

Tobias Burnus burnus@net-b.de
Sat Nov 11 00:14:00 GMT 2006


Hi,

Bernhard Fischer wrote:
>> Current result:
>> Error: ELSE IF clause at (1) requires a scalar LOGICAL expression
>> New result:
>> Error: IF clause at (1) requires a scalar LOGICAL expression
>>     
> Alternatively you could have used IF/ELSE IF like we have for
> WHERE/ELSEWHERE, fwiw :)
>   
We had the "ELSE IF" version in gfc_resolve_blocks and the "IF" version
in gfc_resolve_code.
With this patch it is also unified.

I personally like "IF clause" better (after all ELSE IF is in a sense
also an IF clause) since "IF/ELSEIF" looks too cluttered.
But if "IF/ELSEIF" or "IF/ELSE IF" is prefered, we can also switch to
that version.

> I tend to think that it makes sense to apply such small changes to
> 4.2 too to keep the two in sync as much as possible. Not my call,
> though.
>   

I followed your suggestion and committed this spell fix also to GCC 4.2
Build and regression tested on 4.2 on x86_64-unknown-linux-gnu.

Tobias

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog       (Revision 118670)
+++ gcc/fortran/ChangeLog       (Arbeitskopie)
@@ -1,3 +1,8 @@
+2006-11-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/29454
+       * resolve.c (gfc_resolve_blocks): Fix error message.
+
 2006-11-10  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29539
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (Revision 118670)
+++ gcc/fortran/resolve.c       (Arbeitskopie)
@@ -4749,7 +4749,7 @@
          if (t == SUCCESS && b->expr != NULL
              && (b->expr->ts.type != BT_LOGICAL || b->expr->rank != 0))
            gfc_error
-             ("ELSE IF clause at %L requires a scalar LOGICAL expression",
+             ("IF clause at %L requires a scalar LOGICAL expression",
               &b->expr->where);
          break;



More information about the Fortran mailing list