* lex.c (do_identifier): Don't lookup_name for operators.
* parse.y (operator): Save looking_for_typename.
(unoperator): Restore it.
* spew.c (frob_opname): Use nth_token for lookahead.
testsuite/ChangeLog:
* g++.old-deja/g++.pt/operator1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37340
138bc75d-0d04-0410-961f-
82ee72b054a4
+2000-11-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ * lex.c (do_identifier): Don't lookup_name for operators.
+ * parse.y (operator): Save looking_for_typename.
+ (unoperator): Restore it.
+ * spew.c (frob_opname): Use nth_token for lookahead.
+
2000-11-08 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (grok_op_properties): Always use coerce_new_type and
register tree id;
int lexing = (parsing == 1);
- if (! lexing || IDENTIFIER_OPNAME_P (token))
+ if (! lexing)
id = lookup_name (token, 0);
else
id = lastiddecl;
OPERATOR
{
saved_scopes = tree_cons (got_scope, got_object, saved_scopes);
+ TREE_LANG_FLAG_0 (saved_scopes) = looking_for_typename;
/* 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;
+ 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);
- saved_scopes = TREE_CHAIN (saved_scopes); }
+ looking_for_typename = TREE_LANG_FLAG_0 (saved_scopes);
+ saved_scopes = TREE_CHAIN (saved_scopes);
+ }
;
operator_name:
tree frob_opname (id)
tree id;
{
- frob_id (0, yychar, &id);
+ scan_tokens (0);
+ frob_id (0, nth_token (0)->yychar, &id);
got_object = NULL_TREE;
return id;
}
+2000-11-09 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/operator1.C: New test.
+
2000-11-09 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20001108-1.c: New test.
--- /dev/null
+// Build don't link:
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Nov 2000 <nathan@codesourcery.com>
+// Origin: bug 510 wolfgang.bangerth@iwr.uni-heidelberg.de
+
+struct Example {
+template <class U> void operator= (U);
+};
+
+template <>
+void Example::operator=<double> (double);