diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-07-17 21:57:10 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-07-17 21:57:10 +0200 |
commit | 63523a1fa58d1059e9c2d9ac926873fae010a367 (patch) | |
tree | 52dd10e8bef572d706dc9826d00910855edbbe4e /gcc/fortran | |
parent | 1ff247496641c78fbfbeb6a04db2c8dbdedbcf1f (diff) | |
download | gcc-63523a1fa58d1059e9c2d9ac926873fae010a367.zip gcc-63523a1fa58d1059e9c2d9ac926873fae010a367.tar.gz gcc-63523a1fa58d1059e9c2d9ac926873fae010a367.tar.bz2 |
re PR fortran/34657 (program-unit MY_SUB imports symbol MY_SUB)
2011-07-17 Tobias Burnus <burnus@net-b.de>
PR fortran/34657
* module.c (check_for_ambiguous): Check whether the name is
* matches
the current program unit.
2011-07-17 Tobias Burnus <burnus@net-b.de>
Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/34657
* gfortran.dg/generic_17.f90: Fix testcase.
* gfortran.dg/interface_3.f90: Add dg-error.
* gfortran.dg/use_14.f90: New.
* gfortran.dg/use_15.f90: New.
Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org>
From-SVN: r176375
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/module.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 19339a6..d1f354e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2011-07-17 Tobias Burnus <burnus@net-b.de> + PR fortran/34657 + * module.c (check_for_ambiguous): Check whether the name is matches + the current program unit. + +2011-07-17 Tobias Burnus <burnus@net-b.de> + PR fortran/49624 * expr.c (gfc_check_pointer_assign): Fix checking for invalid pointer bounds. diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 4afe467..b62ad8d 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4278,6 +4278,13 @@ check_for_ambiguous (gfc_symbol *st_sym, pointer_info *info) module_locus locus; symbol_attribute attr; + if (st_sym->ns->proc_name && st_sym->name == st_sym->ns->proc_name->name) + { + gfc_error ("'%s' of module '%s', imported at %C, is also the name of the " + "current program unit", st_sym->name, module_name); + return true; + } + rsym = info->u.rsym.sym; if (st_sym == rsym) return false; |