diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-07-19 23:47:18 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-07-19 19:47:18 -0400 |
commit | e13a41239fcc18a362856e167b7dcb97ca4ee1c2 (patch) | |
tree | c4e8aebae28cb3468ed27a7406fc686f55c19dea /gcc | |
parent | 077e7015e088e0f0ccbd442af857047c5dc10072 (diff) | |
download | gcc-e13a41239fcc18a362856e167b7dcb97ca4ee1c2.zip gcc-e13a41239fcc18a362856e167b7dcb97ca4ee1c2.tar.gz gcc-e13a41239fcc18a362856e167b7dcb97ca4ee1c2.tar.bz2 |
lex.c (do_identifier): Look for class value even if we don't have a global value.
* lex.c (do_identifier): Look for class value even if we don't
have a global value. Do implicit declaration if parsing is 2.
* semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
lookup.
From-SVN: r21291
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/lex.c | 10 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 |
3 files changed, 13 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 09a9b4b..bd3bd68 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +1998-07-19 Jason Merrill <jason@yorick.cygnus.com> + + * lex.c (do_identifier): Look for class value even if we don't + have a global value. Do implicit declaration if parsing is 2. + * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig + lookup. + 1998-07-19 Mark Mitchell <mark@markmitchell.com> * decl.c (pushtag): Revert previous change. diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 8573a85..57639ad 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -2817,17 +2817,17 @@ do_identifier (token, parsing, args) tree args; { register tree id; + int lexing = (parsing == 1); + int in_call = (parsing == 2); - if (! parsing || IDENTIFIER_OPNAME_P (token)) + if (! lexing || IDENTIFIER_OPNAME_P (token)) id = lookup_name (token, 0); else id = lastiddecl; - if (parsing && yychar == YYEMPTY) - yychar = yylex (); /* Scope class declarations before global declarations. */ - if (id && is_global (id) + if ((!id || is_global (id)) && current_class_type != 0 && TYPE_SIZE (current_class_type) == 0) { @@ -2894,7 +2894,7 @@ do_identifier (token, parsing, args) cp_error ("`%D' not defined", token); id = error_mark_node; } - else if (parsing && (yychar == '(' || yychar == LEFT_RIGHT)) + else if (in_call) { id = implicitly_declare (token); } diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 241241d..5068512 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -848,7 +848,7 @@ finish_call_expr (fn, args, koenig) if (TREE_CODE (fn) == BIT_NOT_EXPR) fn = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (fn, 0)); else if (TREE_CODE (fn) != TEMPLATE_ID_EXPR) - fn = do_identifier (fn, 0, args); + fn = do_identifier (fn, 2, args); } result = build_x_function_call (fn, args, current_class_ref); |