summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
commitc9c81ef3c667aaa14c498a5449ec6d134b4b66ff (patch)
tree0ac440db6513ee01deb5e5dc6142769d1e5b7b2d /gcc/cp/class.c
parent12cdcb9d74f55c165366ca1b1eeec013a0ce72ef (diff)
parent891196d7325e4c55d92d5ac5cfe7161c4f36c0ce (diff)
downloadgcc-fortran-dev.tar.gz
Merge from trunk (r239915 to r240230)fortran-dev
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@240290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a4f3c6b6aba..7362c732646 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1796,6 +1796,8 @@ check_bases (tree t,
SET_CLASSTYPE_REF_FIELDS_NEED_INIT
(t, CLASSTYPE_REF_FIELDS_NEED_INIT (t)
| CLASSTYPE_REF_FIELDS_NEED_INIT (basetype));
+ if (TYPE_HAS_MUTABLE_P (basetype))
+ CLASSTYPE_HAS_MUTABLE (t) = 1;
/* A standard-layout class is a class that:
...
@@ -1843,7 +1845,7 @@ check_bases (tree t,
doesn't define its own, then the current class inherits one. */
if (seen_tm_mask && !find_tm_attribute (TYPE_ATTRIBUTES (t)))
{
- tree tm_attr = tm_mask_to_attr (seen_tm_mask & -seen_tm_mask);
+ tree tm_attr = tm_mask_to_attr (least_bit_hwi (seen_tm_mask));
TYPE_ATTRIBUTES (t) = tree_cons (tm_attr, NULL, TYPE_ATTRIBUTES (t));
}
}
@@ -5074,7 +5076,7 @@ set_one_vmethod_tm_attributes (tree type, tree fndecl)
restrictive one. */
else if (tm_attr == NULL)
{
- apply_tm_attr (fndecl, tm_mask_to_attr (found & -found));
+ apply_tm_attr (fndecl, tm_mask_to_attr (least_bit_hwi (found)));
}
/* Otherwise validate that we're not weaker than a function
that is being overridden. */
@@ -8262,7 +8264,12 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t complain)
return error_mark_node;
}
- /* There only a few kinds of expressions that may have a type
+ /* If we instantiate a template, and it is a A ?: C expression
+ with omitted B, look through the SAVE_EXPR. */
+ if (TREE_CODE (rhs) == SAVE_EXPR)
+ rhs = TREE_OPERAND (rhs, 0);
+
+ /* There are only a few kinds of expressions that may have a type
dependent on overload resolution. */
gcc_assert (TREE_CODE (rhs) == ADDR_EXPR
|| TREE_CODE (rhs) == COMPONENT_REF