diff options
author | Jason Merrill <jason@redhat.com> | 2016-08-10 17:58:23 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-08-10 17:58:23 -0400 |
commit | 99f9d4b1b6bd7f072a84a0b19f0397bfa50008cb (patch) | |
tree | 387fdc4230f85dcbe03d25081a8bef0f7568d826 /gcc/cp/ChangeLog | |
parent | e9e6d4f6cc2c0a3407c527f4c786b46508cb3366 (diff) | |
download | gcc-99f9d4b1b6bd7f072a84a0b19f0397bfa50008cb.zip gcc-99f9d4b1b6bd7f072a84a0b19f0397bfa50008cb.tar.gz gcc-99f9d4b1b6bd7f072a84a0b19f0397bfa50008cb.tar.bz2 |
Implement C++17 constexpr if.
* cp-tree.h (IF_STMT_CONSTEXPR_P): New.
* name-lookup.c (push_to_top_level, pop_from_top_level_1): Handle it.
* parser.h (struct cp_parser): Add in_discarded_stmt field.
* parser.c (cp_parser_selection_statement): Handle 'if constexpr'.
(cp_parser_jump_statement): Avoid deducing from a discarded return.
* pt.c (tsubst_expr): Only instantiate taken branch of constexpr if.
* semantics.c (begin_if_stmt): Set the binding level this_entity.
(finish_if_stmt_cond): Require the condition of a
constexpr if to be constant.
* decl.c (level_for_constexpr_if): New.
(named_label_entry): Add in_constexpr_if field.
(poplevel_named_label_1): Set it.
(check_goto): Check it.
(check_previous_goto_1): Check level_for_constexpr_if.
From-SVN: r239338
Diffstat (limited to 'gcc/cp/ChangeLog')
-rw-r--r-- | gcc/cp/ChangeLog | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ca04d64..647b3e6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,21 @@ +2016-08-10 Jason Merrill <jason@redhat.com> + + Implement C++17 constexpr if. + * cp-tree.h (IF_STMT_CONSTEXPR_P): New. + * name-lookup.c (push_to_top_level, pop_from_top_level_1): Handle it. + * parser.h (struct cp_parser): Add in_discarded_stmt field. + * parser.c (cp_parser_selection_statement): Handle 'if constexpr'. + (cp_parser_jump_statement): Avoid deducing from a discarded return. + * pt.c (tsubst_expr): Only instantiate taken branch of constexpr if. + * semantics.c (begin_if_stmt): Set the binding level this_entity. + (finish_if_stmt_cond): Require the condition of a + constexpr if to be constant. + * decl.c (level_for_constexpr_if): New. + (named_label_entry): Add in_constexpr_if field. + (poplevel_named_label_1): Set it. + (check_goto): Check it. + (check_previous_goto_1): Check level_for_constexpr_if. + 2016-08-09 Jason Merrill <jason@redhat.com> PR c++/68703 |