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.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index bf835d7..187a41f 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3713,6 +3713,7 @@ tree
lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
{
int flags = 0;
+ tree t = NULL_TREE;
if (TREE_CODE (scope) == NAMESPACE_DECL)
{
@@ -3722,17 +3723,14 @@ lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
if (is_type_p)
flags |= LOOKUP_PREFER_TYPES;
if (qualified_lookup_using_namespace (name, scope, &binding, flags))
- return select_decl (&binding, flags);
+ t = select_decl (&binding, flags);
}
else if (is_aggr_type (scope, complain))
- {
- tree t;
- t = lookup_member (scope, name, 2, is_type_p);
- if (t)
- return t;
- }
+ t = lookup_member (scope, name, 2, is_type_p);
- return error_mark_node;
+ if (!t)
+ return error_mark_node;
+ return t;
}
/* Subroutine of unqualified_namespace_lookup: