This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51790] New: Broken ambiguity check when combining generic with nongeneric procedures


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]