diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-05 21:57:05 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-05 21:57:05 +0000 |
commit | 998cbf8e414470365f5d2d7d436aa58fe7a60e9e (patch) | |
tree | 0d8b3af3ac0f813a34ca81018ae0dc5d23965642 /gcc/cp/spew.c | |
parent | cc78d173ed4d012a8b57862c914e7c2f22b82e78 (diff) | |
download | gcc-998cbf8e414470365f5d2d7d436aa58fe7a60e9e.tar.gz |
* spew.c (yylex): Also return the TYPE_DECL if got_object.
Don't clear got_object after '~'.
* call.c (build_scoped_method_call): Tweak destructor handling.
(build_method_call): Likewise.
* pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with
TYPE_MAIN_VARIANT for destructors.
* semantics.c (finish_object_call_expr): Complain about calling a
TYPE_DECL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20256 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/spew.c')
-rw-r--r-- | gcc/cp/spew.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c index 0c9e4e39918..1d2cea1d46f 100644 --- a/gcc/cp/spew.c +++ b/gcc/cp/spew.c @@ -327,7 +327,10 @@ yylex () case NSNAME: case PTYPENAME: lastiddecl = trrr; - if (got_scope) + + /* If this got special lookup, remember it. In these cases, + we don't have to worry about being a declarator-id. */ + if (got_scope || got_object) tmp_token.yylval.ttype = trrr; break; @@ -379,7 +382,11 @@ yylex () consume_token (); } - got_object = NULL_TREE; + /* class member lookup only applies to the first token after the object + expression, except for explicit destructor calls. */ + if (tmp_token.yychar != '~') + got_object = NULL_TREE; + yylval = tmp_token.yylval; yychar = tmp_token.yychar; end_of_file = tmp_token.end_of_file; |