[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-02-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 Marek Polacek changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-02-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 --- Comment #8 from Marek Polacek --- Author: mpolacek Date: Sat Feb 24 13:10:44 2018 New Revision: 257961 URL: https://gcc.gnu.org/viewcvs?rev=257961=gcc=rev Log: PR c++/83692 * constexpr.c (maybe_constant_init_1): New

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-25 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 --- Comment #7 from Marek Polacek --- So this works but might be too big a hammer. But I have no better ideas. --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -3663,6 +3663,10 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-25 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 --- Comment #6 from Marek Polacek --- Dang it, hit Save Changes accidentally. That evaluates the AGGR_INIT_EXPR inside by evaluating the constructor of outer: if (m_x.value() != 0) // 1 throw 0; m_x.m_value = integer{1}.value(); // 2

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-25 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 --- Comment #5 from Marek Polacek --- There's a lot that goes on here but the gist is this. In C++17 cp_finish_decl sees "o" initialized with "{}". check_initializer turns this into o = TARGET_EXPR

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-24 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 --- Comment #4 from Marek Polacek --- Seems like in C++17 the condition in if (m_x.value() != 1) throw 0; gets evaluated to 1 instead of 0, so we try to evaluate the "throw 0" but that can't be evaluated to a constant value. Maybe some

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 --- Comment #3 from Marek Polacek --- I plan to investigate this one.

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 Jakub Jelinek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem

2018-01-04 Thread david at doublewise dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692 David Stone changed: What|Removed |Added CC||david at doublewise dot net --- Comment