Re: [PATCH] c++: wrong error with constexpr array and value-init [PR108158]

2023-02-02 Thread Jason Merrill via Gcc-patches
On 1/30/23 21:35, Marek Polacek wrote: In this test case, we find ourselves evaluating 't' which is ((const struct carray *) this)->data_[VIEW_CONVERT_EXPR(index)] in cxx_eval_array_reference. ctx->object is non-null, a RESULT_DECL, so we replace it with 't': new_ctx.object = t; //

[PATCH] c++: wrong error with constexpr array and value-init [PR108158]

2023-01-30 Thread Marek Polacek via Gcc-patches
In this test case, we find ourselves evaluating 't' which is ((const struct carray *) this)->data_[VIEW_CONVERT_EXPR(index)] in cxx_eval_array_reference. ctx->object is non-null, a RESULT_DECL, so we replace it with 't': new_ctx.object = t; // result_decl replaced and then we go to