diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 77bc99134d5..9ccd28a529b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2837,12 +2837,9 @@ extern int flag_new_for_scope; #define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2) #define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2) - -/* Nonzero if NODE is a partial specialization. This flag is not set - for a full specialization. */ -#define CLASSTYPE_PARTIAL_SPECIALIZATION(NODE) \ +#define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) == 2) -#define SET_CLASSTYPE_PARTIAL_SPECIALIZATION(NODE) \ +#define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ (CLASSTYPE_USE_TEMPLATE (NODE) = 2) #define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b42e2794be0..ff2cf407dac 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10647,8 +10647,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) t = ctype; while (t != NULL_TREE && CLASS_TYPE_P (t)) { - if (CLASSTYPE_TEMPLATE_INFO (t) - && uses_template_parms (CLASSTYPE_TI_ARGS (t))) + if (CLASSTYPE_TEMPLATE_INFO (t) && + !CLASSTYPE_TEMPLATE_SPECIALIZATION (t)) template_count += 1; t = TYPE_MAIN_DECL (t); if (DECL_LANG_SPECIFIC (t)) diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index 9ba311478c7..c8152d5336f 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -609,7 +609,6 @@ dequeue_and_dump (di) break; case TEMPLATE_DECL: - dump_child ("rslt", DECL_TEMPLATE_RESULT (t)); dump_child ("inst", DECL_TEMPLATE_INSTANTIATIONS (t)); dump_child ("spcs", DECL_TEMPLATE_SPECIALIZATIONS (t)); break; diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 3663ef3a920..a0be98f8f5f 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -519,7 +519,7 @@ dump_aggr_type (t, flags) typdef = !DECL_ARTIFICIAL (name); tmplate = !typdef && TREE_CODE (t) != ENUMERAL_TYPE && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) - && (CLASSTYPE_PARTIAL_SPECIALIZATION (t) + && (CLASSTYPE_TEMPLATE_SPECIALIZATION (t) || TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL || DECL_TEMPLATE_SPECIALIZATION (CLASSTYPE_TI_TEMPLATE (t)) || PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))); diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index b225ac7c245..fee00a8cf35 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -205,7 +205,7 @@ make_friend_class (type, friend_type) } if (CLASS_TYPE_P (friend_type) - && CLASSTYPE_PARTIAL_SPECIALIZATION (friend_type) + && CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type) && uses_template_parms (friend_type)) { /* [temp.friend] diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c59e8b73554..0978ec9e363 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -190,7 +190,7 @@ finish_member_template_decl (decl) /* Assume that the class is the only declspec. */ decl = TREE_VALUE (decl); if (IS_AGGR_TYPE (decl) && CLASSTYPE_TEMPLATE_INFO (decl) - && ! CLASSTYPE_PARTIAL_SPECIALIZATION (decl)) + && ! CLASSTYPE_TEMPLATE_SPECIALIZATION (decl)) { tree tmpl = CLASSTYPE_TI_TEMPLATE (decl); check_member_template (tmpl); @@ -252,7 +252,7 @@ template_class_depth_real (type, count_specializations) if (CLASSTYPE_TEMPLATE_INFO (type) && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)) && ((count_specializations - && CLASSTYPE_PARTIAL_SPECIALIZATION (type)) + && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)) || uses_template_parms (CLASSTYPE_TI_ARGS (type)))) ++depth; } @@ -666,7 +666,7 @@ maybe_process_partial_specialization (type) cp_pedwarn_at (" from definition of `%#D'", CLASSTYPE_TI_TEMPLATE (type)); } - SET_CLASSTYPE_PARTIAL_SPECIALIZATION (type); + SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type); if (processing_template_decl) push_template_decl (TYPE_MAIN_DECL (type)); } @@ -2359,7 +2359,7 @@ push_template_decl_real (decl, is_friend) /* See if this is a partial specialization. */ is_partial = (DECL_IMPLICIT_TYPEDEF_P (decl) && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE - && CLASSTYPE_PARTIAL_SPECIALIZATION (TREE_TYPE (decl))); + && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl))); is_friend |= (TREE_CODE (decl) == FUNCTION_DECL && DECL_FRIEND_P (decl)); @@ -3548,7 +3548,7 @@ classtype_mangled_name (t) if (CLASSTYPE_TEMPLATE_INFO (t) /* Specializations have already had their names set up in lookup_template_class. */ - && !CLASSTYPE_PARTIAL_SPECIALIZATION (t)) + && !CLASSTYPE_TEMPLATE_SPECIALIZATION (t)) { tree tmpl = most_general_template (CLASSTYPE_TI_TEMPLATE (t)); @@ -3963,7 +3963,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope) /* We only want partial instantiations, here, not specializations or full instantiations. */ - if (CLASSTYPE_PARTIAL_SPECIALIZATION (TREE_VALUE (found)) + if (CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_VALUE (found)) || !uses_template_parms (TREE_VALUE (found))) continue; @@ -9194,7 +9194,7 @@ do_type_instantiation (t, storage) } } - if (CLASSTYPE_PARTIAL_SPECIALIZATION (t)) + if (CLASSTYPE_TEMPLATE_SPECIALIZATION (t)) { /* [temp.spec]