aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index ee0d1a4..6d5d00d 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -2735,7 +2735,10 @@ namespace_binding (tree name, tree scope)
if (scope == NULL)
scope = global_namespace;
- scope = ORIGINAL_NAMESPACE (scope);
+ else
+ /* Unnecessary for the global namespace because it can't be an alias. */
+ scope = ORIGINAL_NAMESPACE (scope);
+
binding = cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
return binding ? binding->value : NULL_TREE;