https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105321
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot
gnu.org
Status|NEW |ASSIGNED
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This sort of obvious patch seems to work:
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -7043,7 +7043,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx,
tree t,
{
/* Check that the LHS is constant and then discard it. */
cxx_eval_constant_expression (ctx, op0,
- true, non_constant_p, overflow_p,
+ lval, non_constant_p, overflow_p,
jump_target);
if (*non_constant_p)
return t;