https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692
Marek Polacek changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
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&root=gcc&view=rev
Log:
PR c++/83692
* constexpr.c (maybe_constant_init_1): New
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 t,
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
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 >>
this goes to store_init_value and th
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 b
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692
--- Comment #3 from Marek Polacek ---
I plan to investigate this one.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692
Jakub Jelinek changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692
David Stone changed:
What|Removed |Added
CC||david at doublewise dot net
--- Comment #1