diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2248d9c9f39..975769f4105 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +1999-02-07 Jason Merrill + + * pt.c (maybe_process_partial_specialization): Complain about + specialization in wrong namespace. + * tree.c (decl_namespace_context): New fn. + +1999-02-06 Kriang Lerdsuwanakij + + * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM. + * pt.c (coerce_template_template_parms): Handle nested + template template parameters. + Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com) * typeck2.c: Update email addrsses. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 1d7385c4223..6bed0bcded3 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3288,6 +3288,7 @@ extern tree break_out_target_exprs PROTO((tree)); extern tree get_type_decl PROTO((tree)); extern tree vec_binfo_member PROTO((tree, tree)); extern tree hack_decl_function_context PROTO((tree)); +extern tree decl_namespace_context PROTO((tree)); extern tree lvalue_type PROTO((tree)); extern tree error_type PROTO((tree)); extern tree make_temp_vec PROTO((int)); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index ba458595f6b..87a25778748 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4483,6 +4483,7 @@ arg_assoc_type (k, type) /* Associate the return type. */ return arg_assoc_type (k, TREE_TYPE (type)); case TEMPLATE_TYPE_PARM: + case TEMPLATE_TEMPLATE_PARM: return 0; case LANG_TYPE: if (type == unknown_type_node) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index dd805da3967..72cf9d0b60f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -672,6 +672,13 @@ maybe_process_partial_specialization (type) if (CLASSTYPE_IMPLICIT_INSTANTIATION (type) && TYPE_SIZE (type) == NULL_TREE) { + if (current_namespace + != decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type))) + { + cp_pedwarn ("specializing `%#T' in different namespace", type); + cp_pedwarn_at (" from definition of `%#D'", + CLASSTYPE_TI_TEMPLATE (type)); + } SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type); if (processing_template_decl) push_template_decl (TYPE_MAIN_DECL (type)); @@ -2804,8 +2811,15 @@ coerce_template_template_parms (parm_parms, arg_parms, in_decl, outer_args) /* We encounter instantiations of templates like template