[Patch, Fortran] PR 31600 - Better diagnosis when redeclaring used-assoc symbol

Tobias Burnus burnus@net-b.de
Tue Aug 23 09:48:00 GMT 2011


Before, one got the following error for the attached test case:
------------------------------------
integer :: bar
               1
Error: Symbol 'bar' at (1) already has basic type of INTEGER
------------------------------------

Which can be a bit puzzling in larger programs. With the patch, one gets:
------------------------------------
use_16.f90:15.14:
integer :: bar
               1
use_16.f90:13.83:
use a
      2
Error: Symbol 'bar' at (1) conflicts with symbol from module 'a', 
use-associated at (2)
------------------------------------


The module change is a bit unrelated but makes the error a bit more 
readable. Instead of having:

  dg-error "Symbol 'bar' at \\(1\\) conflicts with symbol from module 'a'" }
                                                                            2

One now has:

use a ! { dg-error "Symbol 'bar' at \\(1\\) conflicts with symbol from 
module '
     2


Build and regtested on x86-64-linux.
OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redecl-err.diff
Type: text/x-patch
Size: 2608 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110823/72a6ba94/attachment.bin>


More information about the Fortran mailing list