From: Jason Merrill Date: Fri, 24 Jun 2016 21:48:14 +0000 (-0400) Subject: Fix get_target_expr for bit-field expressions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e085858a266dfeb0b335e8cd876872c633c2634;p=gcc.git Fix get_target_expr for bit-field expressions. * tree.c (get_target_expr_sfinae): Handle bit-fields. (build_target_expr): Call mark_rvalue_use. From-SVN: r237773 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 78dd88f20b2..a36cbff0a32 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-06-24 Jason Merrill + + * tree.c (get_target_expr_sfinae): Handle bit-fields. + (build_target_expr): Call mark_rvalue_use. + 2016-06-24 Jakub Jelinek * call.c (magic_varargs_p): Return 3 for __builtin_*_overflow_p. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 6010f63746f..fa8db0afded 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -377,6 +377,8 @@ build_target_expr (tree decl, tree value, tsubst_flags_t complain) tree t; tree type = TREE_TYPE (decl); + value = mark_rvalue_use (value); + gcc_checking_assert (VOID_TYPE_P (TREE_TYPE (value)) || TREE_TYPE (decl) == TREE_TYPE (value) /* On ARM ctors return 'this'. */ @@ -729,7 +731,10 @@ get_target_expr_sfinae (tree init, tsubst_flags_t complain) else if (TREE_CODE (init) == VEC_INIT_EXPR) return build_target_expr (VEC_INIT_EXPR_SLOT (init), init, complain); else - return build_target_expr_with_type (init, TREE_TYPE (init), complain); + { + init = convert_bitfield_to_declared_type (init); + return build_target_expr_with_type (init, TREE_TYPE (init), complain); + } } tree