diff options
author | Janus Weil <janus@gcc.gnu.org> | 2010-01-17 14:33:11 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2010-01-17 14:33:11 +0100 |
commit | ae7c61dead40c0674b58c676a225ca05cea3ffe8 (patch) | |
tree | 8c1bf05482652f2ce135f68f615e6f5f831954e3 /gcc/fortran/interface.c | |
parent | 8232dc642719b5b19812bffd1ee7f40888a7d328 (diff) | |
download | gcc-ae7c61dead40c0674b58c676a225ca05cea3ffe8.zip gcc-ae7c61dead40c0674b58c676a225ca05cea3ffe8.tar.gz gcc-ae7c61dead40c0674b58c676a225ca05cea3ffe8.tar.bz2 |
re PR fortran/42677 (Bogus Error: Ambiguous interfaces '...' in intrinsic assignment operator)
gcc/fortran/
2010-01-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/42677
* gfortran.h (symbol_attribute): Remove 'ambiguous_interfaces'.
* interface.c (check_interface1): Move a warning message here from
resolve_fl_procedure.
(check_sym_interfaces): Removed 'attr.ambiguous_interfaces'.
* module.c (read_module): Remove call to gfc_check_interfaces, since
this comes too early here.
* resolve.c (resolve_fl_procedure): Move warning message to
check_interface1.
gcc/testsuite/
2010-01-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/42677
* gfortran.dg/interface_assignment_5.f90: New test.
From-SVN: r155979
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 2a5ece1..f27d75c 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1132,16 +1132,16 @@ check_interface1 (gfc_interface *p, gfc_interface *q0, NULL, 0)) { if (referenced) - { - gfc_error ("Ambiguous interfaces '%s' and '%s' in %s at %L", - p->sym->name, q->sym->name, interface_name, - &p->where); - } - - if (!p->sym->attr.use_assoc && q->sym->attr.use_assoc) + gfc_error ("Ambiguous interfaces '%s' and '%s' in %s at %L", + p->sym->name, q->sym->name, interface_name, + &p->where); + else if (!p->sym->attr.use_assoc && q->sym->attr.use_assoc) gfc_warning ("Ambiguous interfaces '%s' and '%s' in %s at %L", p->sym->name, q->sym->name, interface_name, &p->where); + else + gfc_warning ("Although not referenced, '%s' has ambiguous " + "interfaces at %L", interface_name, &p->where); return 1; } } @@ -1157,7 +1157,6 @@ static void check_sym_interfaces (gfc_symbol *sym) { char interface_name[100]; - bool k; gfc_interface *p; if (sym->ns != gfc_current_ns) @@ -1184,9 +1183,8 @@ check_sym_interfaces (gfc_symbol *sym) /* Originally, this test was applied to host interfaces too; this is incorrect since host associated symbols, from any source, cannot be ambiguous with local symbols. */ - k = sym->attr.referenced || !sym->attr.use_assoc; - if (check_interface1 (sym->generic, sym->generic, 1, interface_name, k)) - sym->attr.ambiguous_interfaces = 1; + check_interface1 (sym->generic, sym->generic, 1, interface_name, + sym->attr.referenced || !sym->attr.use_assoc); } } |