Commit 9ae8d9df by Jason Merrill Committed by Jason Merrill

cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.

	* cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
	(struct template_parm_index_s): Remove num_siblings.
	* pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
	(fixup_template_type_parm_type): Remove.
	(build_template_parm_index): Remove num_siblings parm.
	(process_template_parm): Likewise.
	* parser.c (cp_parser_template_parameter_list): Adjust.
	* tree.c (cp_tree_equal): Don't compare num_siblings.
	* typeck.c (comp_template_parms_position): Likewise.

From-SVN: r189299
parent 49bb4bbe
2012-07-05 Jason Merrill <jason@redhat.com>
* cp-tree.h (TEMPLATE_PARM_NUM_SIBLINGS): Remove.
(struct template_parm_index_s): Remove num_siblings.
* pt.c (fixup_template_parms, fixup_template_parm_index): Remove.
(fixup_template_type_parm_type): Remove.
(build_template_parm_index): Remove num_siblings parm.
(process_template_parm): Likewise.
* parser.c (cp_parser_template_parameter_list): Adjust.
* tree.c (cp_tree_equal): Don't compare num_siblings.
* typeck.c (comp_template_parms_position): Likewise.
PR c++/50852
PR c++/53039
* tree.c (strip_typedefs_expr): New.
......
......@@ -249,7 +249,6 @@ struct GTY(()) template_parm_index_s {
int index;
int level;
int orig_level;
int num_siblings;
tree decl;
};
typedef struct template_parm_index_s template_parm_index;
......@@ -4523,9 +4522,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, TYPENAME_FLAG };
((template_parm_index*)TEMPLATE_PARM_INDEX_CHECK (NODE))
#define TEMPLATE_PARM_IDX(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->index)
#define TEMPLATE_PARM_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->level)
/* The Number of sibling parms this template parm has. */
#define TEMPLATE_PARM_NUM_SIBLINGS(NODE) \
(TEMPLATE_PARM_INDEX_CAST (NODE)->num_siblings)
#define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
#define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
#define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
......@@ -5316,9 +5312,8 @@ extern void append_type_to_template_for_access_check (tree, tree, tree,
extern tree splice_late_return_type (tree, tree);
extern bool is_auto (const_tree);
extern tree process_template_parm (tree, location_t, tree,
bool, bool, unsigned);
bool, bool);
extern tree end_template_parm_list (tree);
void fixup_template_parms (void);
extern void end_template_decl (void);
extern tree maybe_update_decl_type (tree, tree);
extern bool check_default_tmpl_args (tree, tree, int, int, int);
......
......@@ -11993,8 +11993,7 @@ cp_parser_template_parameter_list (cp_parser* parser)
parm_loc,
parameter,
is_non_type,
is_parameter_pack,
0);
is_parameter_pack);
else
{
tree err_parm = build_tree_list (parameter, parameter);
......
......@@ -2568,9 +2568,6 @@ cp_tree_equal (tree t1, tree t2)
BASELINK_FUNCTIONS (t2)));
case TEMPLATE_PARM_INDEX:
if (TEMPLATE_PARM_NUM_SIBLINGS (t1)
!= TEMPLATE_PARM_NUM_SIBLINGS (t2))
return false;
return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2)
&& TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2)
&& (TEMPLATE_PARM_PARAMETER_PACK (t1)
......
......@@ -1140,12 +1140,6 @@ comp_template_parms_position (tree t1, tree t2)
index1 = TEMPLATE_TYPE_PARM_INDEX (TYPE_MAIN_VARIANT (t1));
index2 = TEMPLATE_TYPE_PARM_INDEX (TYPE_MAIN_VARIANT (t2));
/* If T1 and T2 belong to template parm lists of different size,
let's assume they are different. */
if (TEMPLATE_PARM_NUM_SIBLINGS (index1)
!= TEMPLATE_PARM_NUM_SIBLINGS (index2))
return false;
/* Then compare their relative position. */
if (TEMPLATE_PARM_IDX (index1) != TEMPLATE_PARM_IDX (index2)
|| TEMPLATE_PARM_LEVEL (index1) != TEMPLATE_PARM_LEVEL (index2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment