+2004-09-20 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/17530
+ * pt.c (tsubst): Fix parentheses to accomodate emacs.
+ (tsubst_baselink): If we get a single function, mark it as used.
+
2004-09-20 Matt Austern <austern@apple.com>
Zack Weinberg <zack@codesourcery.com>
single bad template instantiation. */
if (complain & tf_error
#ifdef USE_MAPPED_LOCATION
- && last_loc != input_location)
+ && last_loc != input_location
#else
&& (last_loc.line != input_line
- || last_loc.file != input_filename))
+ || last_loc.file != input_filename)
#endif
+ )
{
if (TREE_CODE (type) == VOID_TYPE)
error ("forming reference to void");
}
name = DECL_NAME (get_first_fn (fns));
baselink = lookup_fnfields (qualifying_scope, name, /*protect=*/1);
+
+ /* If lookup found a single function, mark it as used at this
+ point. (If it lookup found multiple functions the one selected
+ later by overload resolution will be marked as used at that
+ point.) */
+ if (BASELINK_P (baselink))
+ fns = BASELINK_FUNCTIONS (baselink);
+ if (!template_id_p && !really_overloaded_fn (fns))
+ mark_used (OVL_CURRENT (fns));
+
+ /* Add back the template arguments, if present. */
if (BASELINK_P (baselink) && template_id_p)
BASELINK_FUNCTIONS (baselink)
= build_nt (TEMPLATE_ID_EXPR,
BASELINK_FUNCTIONS (baselink),
template_args);
+
if (!object_type)
object_type = current_class_type;
return adjust_result_of_qualified_name_lookup (baselink,