+Wed Sep 3 00:02:53 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * typeck.c (convert_arguments): Don't arbitrarily choose the first
+ of a set of overloaded functions.
+
Tue Sep 2 12:09:13 1997 Jason Merrill <jason@yorick.cygnus.com>
+ * lex.c (real_yylex): Don't elide __FUNCTION__.
+
* method.c (build_overload_value): Add in_template parm.
(build_overload_int): Likewise.
(build_overload_identifier): Pass it.
return error_mark_node;
}
- /* Pedantically, it is ill-formed to define a function that could
- also be a template instantiation, but we won't implement that
- until things settle down. */
+ /* Pedantically, normal function declarations are never considered
+ to refer to template instantiations, but we won't implement that
+ until we implement full template instantiation syntax. */
if (templates && ! cand->template && ! DECL_INITIAL (cand->fn))
add_maybe_template (cand->fn, templates);
#endif
yylval.ttype = tmp;
-
- /* A user-invisible read-only initialized variable
- should be replaced by its value. We only handle strings
- since that's the only case used in C (and C++). */
- /* Note we go right after the local value for the identifier
- (e.g., __FUNCTION__ or __PRETTY_FUNCTION__). We used to
- call lookup_name, but that could result in an error about
- ambiguities. */
- tmp = IDENTIFIER_LOCAL_VALUE (yylval.ttype);
- if (tmp != NULL_TREE
- && TREE_CODE (tmp) == VAR_DECL
- && DECL_IGNORED_P (tmp)
- && TREE_READONLY (tmp)
- && DECL_INITIAL (tmp) != NULL_TREE
- && TREE_CODE (DECL_INITIAL (tmp)) == STRING_CST)
- {
- tree stringval = DECL_INITIAL (tmp);
-
- /* Copy the string value so that we won't clobber anything
- if we put something in the TREE_CHAIN of this one. */
- yylval.ttype = build_string (TREE_STRING_LENGTH (stringval),
- TREE_STRING_POINTER (stringval));
- value = STRING;
- }
}
if (value == NEW && ! global_bindings_p ())
{
TREE_VALUE (d) = xref_tag_from_type (TREE_VALUE (d), NULL_TREE, 1);
d = tsubst (DECL_TEMPLATE_INJECT (template), &TREE_VEC_ELT (args, 0),
- TREE_VEC_LENGTH (args), NULL_TREE);
+ TREE_VEC_LENGTH (args), NULL_TREE);
for (; d; d = TREE_CHAIN (d))
{
/* Strip the `&' from an overloaded FUNCTION_DECL. */
if (TREE_CODE (val) == ADDR_EXPR)
val = TREE_OPERAND (val, 0);
- if (TREE_CODE (val) == TREE_LIST
- && TREE_CHAIN (val) == NULL_TREE
- && TREE_TYPE (TREE_VALUE (val)) != NULL_TREE
- && (TREE_TYPE (val) == unknown_type_node
- || DECL_CHAIN (TREE_VALUE (val)) == NULL_TREE))
- /* Instantiates automatically. */
- val = TREE_VALUE (val);
+ if (really_overloaded_fn (val))
+ cp_error ("insufficient type information to resolve address of overloaded function `%D'",
+ DECL_NAME (get_first_fn (val)));
else
- {
- error ("insufficient type information in parameter list");
- val = integer_zero_node;
- }
+ error ("insufficient type information in parameter list");
+ val = integer_zero_node;
}
else if (TREE_CODE (val) == OFFSET_REF
&& TREE_CODE (TREE_TYPE (val)) == METHOD_TYPE)