+1998-10-06 Mark Mitchell <mark@markmitchell.com>
+
+ * call.c (resolve_args): Resolve template specializations, if
+ possible.
+
Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (spew.o): Depend on toplev.h.
}
else if (TREE_CODE (TREE_VALUE (t)) == OFFSET_REF)
TREE_VALUE (t) = resolve_offset_ref (TREE_VALUE (t));
+ else if (TREE_CODE (TREE_VALUE (t)) == TEMPLATE_ID_EXPR)
+ {
+ tree targs;
+ tree r;
+
+ r = determine_specialization (TREE_VALUE (t), NULL_TREE,
+ &targs,
+ /*need_member_template=*/0,
+ /*complain=*/0);
+
+ /* If we figured out what was being specialized, use it.
+ Otherwise, the function being called may resolve the
+ choice of specialization, so we don't issue any error
+ messages here. */
+ if (r)
+ {
+ r = instantiate_template (r, targs);
+ TREE_VALUE (t) = r;
+ }
+ }
}
return args;
}
// Build don't link:
-// crash test - XFAIL *-*-*
-
template <class T> void foo(T);
template <class T> void bar(void (*)(T), T);
void baz() {
bar<int>(foo, 1);
- bar(foo<int>, 1); // explicit args for foo don't help
- bar<int>(foo<int>, 1); // not even here
- bar(foo, 1);
+ bar(foo<int>, 1);
+ bar<int>(foo<int>, 1);
+ bar(foo, 1);
}