parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER in Koenig lookup support rules.

* parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
	in Koenig lookup support rules.
	* semantics.c (finish_call_expr): Handle the new cases.
	* typeck.c (build_x_function_call): Handle overloaded methods.
	* decl.c (grokvardecl): Don't call build_static_name for extern "C".

From-SVN: r21245
This commit is contained in:
Jason Merrill 1998-07-17 02:48:08 +00:00 committed by Jason Merrill
parent 32dd8ef8f3
commit 03d8299153
7 changed files with 2264 additions and 2236 deletions

View File

@ -1,3 +1,13 @@
1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
in Koenig lookup support rules.
* semantics.c (finish_call_expr): Handle the new cases.
* typeck.c (build_x_function_call): Handle overloaded methods.
* decl.c (grokvardecl): Don't call build_static_name for extern "C".
1998-07-16 Mark Mitchell <mark@markmitchell.com>
* semantics.c (finish_object_call_expr): Revert previous change.

View File

@ -215,7 +215,7 @@ parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
CONFLICTS = expect 22 shift/reduce conflicts and 42 reduce/reduce conflicts.
CONFLICTS = expect 28 shift/reduce conflicts and 42 reduce/reduce conflicts.
$(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS)

View File

@ -8037,7 +8037,8 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
{
tree context = in_namespace ? in_namespace : current_namespace;
decl = build_decl (VAR_DECL, declarator, complete_type (type));
if (context != global_namespace && namespace_bindings_p ())
if (context != global_namespace && namespace_bindings_p ()
&& current_lang_name != lang_name_c)
DECL_ASSEMBLER_NAME (decl) = build_static_name (context,
declarator);
}

File diff suppressed because it is too large Load Diff

View File

@ -1363,9 +1363,9 @@ primary:
/* Koenig lookup support
We could store lastiddecl in $1 to avoid another lookup,
but that would result in many additional reduce/reduce conflicts. */
| IDENTIFIER '(' nonnull_exprlist ')'
| notype_unqualified_id '(' nonnull_exprlist ')'
{ $$ = finish_call_expr ($1, $3, 1); }
| IDENTIFIER LEFT_RIGHT
| notype_unqualified_id LEFT_RIGHT
{ $$ = finish_call_expr ($1, NULL_TREE, 1); }
| primary '(' nonnull_exprlist ')'
{ $$ = finish_call_expr ($1, $3, 0); }

View File

@ -844,7 +844,12 @@ finish_call_expr (fn, args, koenig)
tree result;
if (koenig)
fn = do_identifier (fn, 0, args);
{
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);
}
result = build_x_function_call (fn, args, current_class_ref);
if (TREE_CODE (result) == CALL_EXPR

View File

@ -2436,6 +2436,8 @@ build_x_function_call (function, params, decl)
my_friendly_assert (TREE_CODE (function) == TREE_LIST, 999);
my_friendly_assert (TREE_CHAIN (function) == NULL_TREE, 999);
function = TREE_VALUE (function);
if (TREE_CODE (function) == OVERLOAD)
function = OVL_FUNCTION (function);
my_friendly_assert (TREE_CODE (function) == FUNCTION_DECL, 999);
function = DECL_NAME (function);
return build_method_call (decl, function, params,