2010-03-26 Dodji Seketeli <dodji@redhat.com>
+ PR c++/43327
+ * pt.c (add_to_template_args): Support NULL ARGS;
+ (most_specialized_class): call coerce_template_parms on
+ template arguments passed to get_class_bindings. Use
+ add_to_template_args.
+ (unify): Handle VAR_DECLs.
+
+2010-03-26 Dodji Seketeli <dodji@redhat.com>
+
* cp-tree.h (get_template_parms_at_level): Change unsigned parm
into int.
* pt.c (get_template_parms_at_level): Adjust.
int i;
int j;
+ if (args == NULL_TREE)
+ return extra_args;
+
extra_depth = TMPL_ARGS_DEPTH (extra_args);
new_args = make_tree_vec (TMPL_ARGS_DEPTH (args) + extra_depth);
/* Matched cases are handled by the ARG == PARM test above. */
return 1;
+ case VAR_DECL:
+ /* A non-type template parameter that is a variable should be a
+ an integral constant, in which case, it whould have been
+ folded into its (constant) value. So we should not be getting
+ a variable here. */
+ gcc_unreachable ();
+
case TYPE_ARGUMENT_PACK:
case NONTYPE_ARGUMENT_PACK:
{
--processing_template_decl;
}
+
+ partial_spec_args =
+ coerce_template_parms (DECL_INNERMOST_TEMPLATE_PARMS (tmpl),
+ add_to_template_args (outer_args,
+ partial_spec_args),
+ tmpl, tf_none,
+ /*require_all_args=*/true,
+ /*use_default_args=*/true);
+
+ if (partial_spec_args == error_mark_node)
+ return error_mark_node;
+
spec_args = get_class_bindings (parms,
partial_spec_args,
args);
+2010-03-26 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/43327
+ * g++.dg/other/crash-10.C: New test.
+ * g++.dg/other/crash-11.C: New test.
+
2010-03-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/43517
--- /dev/null
+// Origin: PR c++/43327
+// { dg-do compile }
+
+template <typename _T>
+struct A
+{
+ template <int _N, int _M> struct B;
+
+ template <int _N>
+ struct B<_N, _T::m>
+ {
+ static void f();
+ };
+};
+
+struct C
+{
+ static int m;
+};
+
+void m()
+{
+ A<C>::B<1, 4>::f(); // { dg-error "incomplete type|not a valid" }
+}
+
+int C::m = 4;
+