* pt.c (lookup_template_class): push_tinst_level around call to
coerce_template_parms.
From-SVN: r165974
2010-10-26 Jason Merrill <jason@redhat.com>
2010-10-26 Jason Merrill <jason@redhat.com>
+ * pt.c (lookup_template_class): push_tinst_level around call to
+ coerce_template_parms.
+
* tree.c (stabilize_expr): Handle xvalues properly.
* call.c (build_over_call): Use argarray[0] for 'this' argument.
* tree.c (stabilize_expr): Handle xvalues properly.
* call.c (build_over_call): Use argarray[0] for 'this' argument.
arglist = bound_args;
}
else
arglist = bound_args;
}
else
- arglist
- = coerce_template_parms (INNERMOST_TEMPLATE_PARMS (parmlist),
- INNERMOST_TEMPLATE_ARGS (arglist),
- gen_tmpl,
- complain,
- /*require_all_args=*/true,
- /*use_default_args=*/true);
+ {
+ push_tinst_level (templ);
+ arglist
+ = coerce_template_parms (INNERMOST_TEMPLATE_PARMS (parmlist),
+ INNERMOST_TEMPLATE_ARGS (arglist),
+ gen_tmpl,
+ complain,
+ /*require_all_args=*/true,
+ /*use_default_args=*/true);
+ pop_tinst_level ();
+ }
if (arglist == error_mark_node)
/* We were unable to bind the arguments. */
if (arglist == error_mark_node)
/* We were unable to bind the arguments. */
+2010-10-26 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/template/arg8.C: Test for helpful diagnostic.
+
2010-10-26 Janus Weil <janus@gcc.gnu.org>
PR fortran/42647
2010-10-26 Janus Weil <janus@gcc.gnu.org>
PR fortran/42647
--- /dev/null
+// Test for a message indicating what template we're trying to convert
+// arguments for. We can't actually test for it directly because it
+// doesn't have an associated line number, but we can test for the
+// "instantiated from here" message that follows.
+
+template <int I>
+struct A { };
+
+int i;
+A<i> a; // { dg-message "instantiated from here" }
+// { dg-error "not a valid template argument" "" { target *-*-* } 10 }
+// { dg-error "invalid type in declaration" "" { target *-*-* } 10 }