aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parse.y
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2000-10-21 17:44:04 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-10-21 17:44:04 -0400
commitaca77bd196cb6f04c215db0380c77dda140b0258 (patch)
tree9e176ae2ca30f22b3b8c361b8ed56389f44884f1 /gcc/cp/parse.y
parentfac045536fefda3972f6c5d42ab60431a41f6d03 (diff)
downloadgcc-aca77bd196cb6f04c215db0380c77dda140b0258.zip
gcc-aca77bd196cb6f04c215db0380c77dda140b0258.tar.gz
gcc-aca77bd196cb6f04c215db0380c77dda140b0258.tar.bz2
parse.y (operator): Set got_object from got_scope.
* parse.y (operator): Set got_object from got_scope. Set looking_for_typename. * decl.c (lookup_name_real): Clear val after setting from_obj. Reorganize diagnostic. From-SVN: r37000
Diffstat (limited to 'gcc/cp/parse.y')
-rw-r--r--gcc/cp/parse.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y
index 27075e8..5e99862 100644
--- a/gcc/cp/parse.y
+++ b/gcc/cp/parse.y
@@ -3745,9 +3745,15 @@ conversion_declarator:
operator:
OPERATOR
- { saved_scopes = tree_cons (got_scope, got_object, saved_scopes);
- got_scope = NULL_TREE; got_object = NULL_TREE; }
+ {
+ saved_scopes = tree_cons (got_scope, got_object, saved_scopes);
+ /* We look for conversion-type-id's in both the class and current
+ scopes, just as for ID in 'ptr->ID::'. */
+ looking_for_typename = 1; got_object = got_scope;
+ got_scope = NULL_TREE;
+ }
;
+
unoperator:
{ got_scope = TREE_PURPOSE (saved_scopes);
got_object = TREE_VALUE (saved_scopes);
@@ -3821,7 +3827,6 @@ operator_name:
{ $$ = frob_opname (ansi_opname (VEC_NEW_EXPR)); }
| operator DELETE '[' ']' unoperator
{ $$ = frob_opname (ansi_opname (VEC_DELETE_EXPR)); }
- /* Names here should be looked up in class scope ALSO. */
| operator type_specifier_seq conversion_declarator unoperator
{ $$ = frob_opname (grokoptypename ($2.t, $3)); }
| operator error unoperator