[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-06-20 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #5 from Volker Reichelt  ---
*** Bug 80971 has been marked as a duplicate of this bug. ***

[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-06-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jason Merrill  ---
Fixed.

[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-06-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

--- Comment #3 from Jason Merrill  ---
Author: jason
Date: Mon Jun 19 20:56:08 2017
New Revision: 249389

URL: https://gcc.gnu.org/viewcvs?rev=249389=gcc=rev
Log:
PR c++/80562 - ICE with constexpr if.

* semantics.c (finish_if_stmt_cond): Call
instantiate_non_dependent_expr.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/constexpr-if12.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/semantics.c

[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-06-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Mon Jun 19 20:55:27 2017
New Revision: 249387

URL: https://gcc.gnu.org/viewcvs?rev=249387=gcc=rev
Log:
PR c++/80562 - ICE with constexpr if.

* semantics.c (finish_if_stmt_cond): Call
instantiate_non_dependent_expr.

Added:
trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if12.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/semantics.c

[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-06-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/80562] [7/8 Regression] ICE using if constexpr with nonconstant expression in function template

2017-05-02 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80562

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-05-02
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |7.2
Summary|ICE using if constexpr with |[7/8 Regression] ICE using
   |nonconstant expression in   |if constexpr with
   |function template   |nonconstant expression in
   ||function template
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
commit df5390a9de5322cbaab3def921d3d517d4494144
Author: jason 
Date:   Wed Aug 10 21:58:23 2016 +

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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239338
138bc75d-0d04-0410-961f-82ee72b054a4