This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/51790] New: Broken ambiguity check when combining generic with nongeneric procedures
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Jan 2012 23:31:11 +0000
- Subject: [Bug fortran/51790] New: Broken ambiguity check when combining generic with nongeneric procedures
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51790
Bug #: 51790
Summary: Broken ambiguity check when combining generic with
nongeneric procedures
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: accepts-invalid, diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
Blocks: 51578
Another bug which blocks my progress with PR 51578.
If one compiles
gfortran.dg/generic_11.f90
one gets the error:
call foo ! { dg-error "is an ambiguous reference" }
1
Error: Name 'foo' at (1) is an ambiguous reference to 'foo' from module
'm_foo'
However, if one swaps the order of
use m_foo
use m_bar
no error is printed.
The reason is that in symbol's gfc_find_sym_tree one has the check:
if (st->ambiguous && !st->n.sym->attr.generic)
{
ambiguous_symbol (name, st);
However, one of the "foo" is generic and the other isn't. Thus, depending which
one is first in the symtree, an error is printed or not.