aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-10-18 14:35:33 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-10-18 14:35:33 +0000
commit4db45577b797e63299dc362106bd4c562c5ea41b (patch)
tree146ebe74e8657e73f6e6a2f07abfdf9020796f75
parent134e622524d87ff9b52d6a51c5e58259cff25976 (diff)
downloadgcc-4db45577b797e63299dc362106bd4c562c5ea41b.zip
gcc-4db45577b797e63299dc362106bd4c562c5ea41b.tar.gz
gcc-4db45577b797e63299dc362106bd4c562c5ea41b.tar.bz2
parser.c (cp_parser_lookup_name): Tidy.
2013-10-18 Paolo Carlini <paolo.carlini@oracle.com> * parser.c (cp_parser_lookup_name): Tidy. From-SVN: r203822
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/parser.c25
2 files changed, 17 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4a5043a..2ef2978 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * parser.c (cp_parser_lookup_name): Tidy.
+
2013-10-17 Andrew MacLeod <amacleod@redhat.com>
* parser.c: Include omp-low.h.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 54520b4..10a7b96 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -21882,7 +21882,6 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
}
else if (object_type)
{
- tree object_decl = NULL_TREE;
/* Look up the name in the scope of the OBJECT_TYPE, unless the
OBJECT_TYPE is not a class. */
if (CLASS_TYPE_P (object_type))
@@ -21890,19 +21889,21 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
be instantiated during name lookup. In that case, errors
may be issued. Even if we rollback the current tentative
parse, those errors are valid. */
- object_decl = lookup_member (object_type,
- name,
- /*protect=*/0,
- tag_type != none_type,
- tf_warning_or_error);
- /* Look it up in the enclosing context, too. */
- decl = lookup_name_real (name, tag_type != none_type,
- /*nonclass=*/0,
- /*block_p=*/true, is_namespace, 0);
+ decl = lookup_member (object_type,
+ name,
+ /*protect=*/0,
+ tag_type != none_type,
+ tf_warning_or_error);
+ else
+ decl = NULL_TREE;
+
+ if (!decl)
+ /* Look it up in the enclosing context. */
+ decl = lookup_name_real (name, tag_type != none_type,
+ /*nonclass=*/0,
+ /*block_p=*/true, is_namespace, 0);
parser->object_scope = object_type;
parser->qualifying_scope = NULL_TREE;
- if (object_decl)
- decl = object_decl;
}
else
{