check_module_override (tree decl, tree mvec, bool hiding,
tree scope, tree name)
{
+ tree match = NULL_TREE;
bitmap imports = get_import_bitmap ();
binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (mvec);
unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (mvec);
bind = STAT_VISIBLE (bind);
for (ovl_iterator iter (bind); iter; ++iter)
- if (iter.using_p ())
- ;
- else if (tree match = duplicate_decls (decl, *iter, hiding))
- return match;
+ if (!iter.using_p ())
+ {
+ match = duplicate_decls (decl, *iter, hiding);
+ if (match)
+ goto matched;
+ }
}
- if (TREE_PUBLIC (scope) && TREE_PUBLIC (decl) && !not_module_p ()
+ if (TREE_PUBLIC (scope) && TREE_PUBLIC (STRIP_TEMPLATE (decl))
/* Namespaces are dealt with specially in
make_namespace_finish. */
&& !(TREE_CODE (decl) == NAMESPACE_DECL && !DECL_NAMESPACE_ALIAS (decl)))
for (ovl_iterator iter (mergeable); iter; ++iter)
{
- tree match = *iter;
-
- if (duplicate_decls (decl, match, hiding))
- return match;
+ match = duplicate_decls (decl, *iter, hiding);
+ if (match)
+ goto matched;
}
}
return NULL_TREE;
+
+ matched:
+ if (match != error_mark_node)
+ {
+ if (named_module_p ())
+ BINDING_VECTOR_PARTITION_DUPS_P (mvec) = true;
+ else
+ BINDING_VECTOR_GLOBAL_DUPS_P (mvec) = true;
+ }
+
+ return match;
+
+
}
/* Record DECL as belonging to the current lexical scope. Check for