aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2017-07-31 14:52:19 +0000
committerMartin Jambor <mjambor@suse.cz>2017-07-31 14:52:19 +0000
commit7e05bab54f745defb749670b8c84eaf513c0b214 (patch)
tree49524df297e69390449c3ef5037b2360d14c7b1a /gcc/cp/tree.c
parent77b800ca8b1cca32db99261ade36bf5f0eafaff8 (diff)
Merged trunk revision 250739 into the hsa branch
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/hsa@250744 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index bb17278c611..2122450c653 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -90,7 +90,6 @@ lvalue_kind (const_tree ref)
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
case TRY_CATCH_EXPR:
- case WITH_CLEANUP_EXPR:
case REALPART_EXPR:
case IMAGPART_EXPR:
return lvalue_kind (TREE_OPERAND (ref, 0));
@@ -1503,13 +1502,13 @@ strip_typedefs (tree t, bool *remove_attributes)
break;
case TYPENAME_TYPE:
{
+ bool changed = false;
tree fullname = TYPENAME_TYPE_FULLNAME (t);
if (TREE_CODE (fullname) == TEMPLATE_ID_EXPR
&& TREE_OPERAND (fullname, 1))
{
tree args = TREE_OPERAND (fullname, 1);
tree new_args = copy_node (args);
- bool changed = false;
for (int i = 0; i < TREE_VEC_LENGTH (args); ++i)
{
tree arg = TREE_VEC_ELT (args, i);
@@ -1533,12 +1532,15 @@ strip_typedefs (tree t, bool *remove_attributes)
else
ggc_free (new_args);
}
- result = make_typename_type (strip_typedefs (TYPE_CONTEXT (t),
- remove_attributes),
- fullname, typename_type, tf_none);
- /* Handle 'typedef typename A::N N;' */
- if (typedef_variant_p (result))
- result = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (TYPE_NAME (result)));
+ tree ctx = strip_typedefs (TYPE_CONTEXT (t), remove_attributes);
+ if (!changed && ctx == TYPE_CONTEXT (t) && !typedef_variant_p (t))
+ return t;
+ tree name = fullname;
+ if (TREE_CODE (fullname) == TEMPLATE_ID_EXPR)
+ name = TREE_OPERAND (fullname, 0);
+ /* Use build_typename_type rather than make_typename_type because we
+ don't want to resolve it here, just strip typedefs. */
+ result = build_typename_type (ctx, name, fullname, typename_type);
}
break;
case DECLTYPE_TYPE:
@@ -3581,16 +3583,6 @@ cp_tree_equal (tree t1, tree t2)
return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1));
}
- case WITH_CLEANUP_EXPR:
- if (!cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)))
- return false;
- return cp_tree_equal (TREE_OPERAND (t1, 1), TREE_OPERAND (t1, 1));
-
- case COMPONENT_REF:
- if (TREE_OPERAND (t1, 1) != TREE_OPERAND (t2, 1))
- return false;
- return cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
-
case PARM_DECL:
/* For comparing uses of parameters in late-specified return types
with an out-of-class definition of the function, but can also come
@@ -3984,8 +3976,7 @@ type_has_nontrivial_copy_init (const_tree type)
else if (CLASSTYPE_LAZY_COPY_CTOR (t))
{
saw_copy = true;
- if (type_has_user_declared_move_constructor (t)
- || type_has_user_declared_move_assign (t))
+ if (classtype_has_move_assign_or_move_ctor_p (t, true))
/* [class.copy]/8 If the class definition declares a move
constructor or move assignment operator, the implicitly declared
copy constructor is defined as deleted.... */;