diff options
author | Jason Merrill <jason@redhat.com> | 2014-10-27 13:42:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-10-27 13:42:12 -0400 |
commit | 3e605b20a0c804d57d4be0f4f2bbab8b4e42fce6 (patch) | |
tree | ac2bca0b20f76ea658c7bbcb7dda73ababce83b9 /gcc/cp/error.c | |
parent | ddc8de034a1f79861fed57b231813a5c5c48a130 (diff) | |
download | gcc-3e605b20a0c804d57d4be0f4f2bbab8b4e42fce6.zip gcc-3e605b20a0c804d57d4be0f4f2bbab8b4e42fce6.tar.gz gcc-3e605b20a0c804d57d4be0f4f2bbab8b4e42fce6.tar.bz2 |
Implement N3653 (Member initializers and aggregates) and fix references to 'this' in constexpr constructors.
Implement N3653 (Member initializers and aggregates) and fix
references to 'this' in constexpr constructors.
* class.c (check_field_decls): In C++14 an NSDMI does not make the
class non-aggregate.
* constexpr.c (struct constexpr_ctx): New.
(cxx_bind_parameters_in_call): Handle 'this'.
(cxx_eval_call_expression): Create new constexpr_ctx.
(cxx_eval_component_reference): Check CONSTRUCTOR_NO_IMPLICIT_ZERO.
(initialized_type, init_subob_ctx, verify_ctor_sanity): New.
(cxx_eval_bare_aggregate): Use them. Build CONSTRUCTOR early.
(cxx_eval_vec_init_1): Likewise.
(cxx_eval_constant_expression) [PARM_DECL]: Allow 'this'.
[TARGET_EXPR]: Build new constexpr_ctx.
[PLACEHOLDER_EXPR]: New.
(cxx_eval_outermost_constant_expr): Build new constexpr_ctx. Add
object parameter.
(is_sub_constant_expr): Build new constexpr_ctx.
(potential_constant_expression_1): Handle PLACEHOLDER_EXPR.
Allow 'this'.
* cp-gimplify.c (cp_gimplify_init_expr): Call replace_placeholders.
* cp-tree.h (CONSTRUCTOR_NO_IMPLICIT_ZERO): New.
* error.c (dump_expr): Handle PLACEHOLDER_EXPR.
* init.c (get_nsdmi): Generate PLACEHOLDER_EXPR.
* tree.c (lvalue_kind): Handle PLACEHOLDER_EXPR.
(build_ctor_subob_ref, replace_placeholders): New.
* typeck2.c (store_init_value): Use replace_placeholders.
(process_init_constructor_record): Make zero-init before NSDMI
explicit.
From-SVN: r216750
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 755bb00..76f86cb 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2673,6 +2673,10 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) pp_cxx_right_paren (pp); break; + case PLACEHOLDER_EXPR: + pp_string (pp, M_("*this")); + break; + /* This list is incomplete, but should suffice for now. It is very important that `sorry' does not call `report_error_function'. That could cause an infinite loop. */ |