http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48821
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-04-29 15:44:32 UTC --- The following in decl.c's gfc_match_import looks wrong: if (gfc_current_ns->parent != NULL && gfc_find_symbol (name, gfc_current_ns->parent, 1, &sym)) { gfc_error ("Type name '%s' at %C is ambiguous", name); return MATCH_ERROR; } else if (gfc_current_ns->proc_name->ns->parent != NULL && gfc_find_symbol (name, gfc_current_ns->proc_name->ns->parent, 1, &sym)) I think a "sym == NULL &&" is missing in the else branch.