https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115900
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 #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Thus:
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -3123,10 +3123,14 @@ cxx_eval_call_expression (const constexpr_ctx *ctx,
tree t,
At this point it has already been evaluated in the call
to cxx_bind_parameters_in_call. */
new_obj = TREE_VEC_ELT (new_call.bindings, 0);
- new_obj = cxx_fold_indirect_ref (ctx, loc, DECL_CONTEXT (fun), new_obj);
-
- if (ctx->call && ctx->call->fundef
- && DECL_CONSTRUCTOR_P (ctx->call->fundef->decl))
+ bool empty_base = false;
+ new_obj = cxx_fold_indirect_ref (ctx, loc, DECL_CONTEXT (fun), new_obj,
+ &empty_base);
+
+ if (empty_base)
+ new_obj = NULL_TREE;
+ else if (ctx->call && ctx->call->fundef
+ && DECL_CONSTRUCTOR_P (ctx->call->fundef->decl))
{
tree cur_obj = TREE_VEC_ELT (ctx->call->bindings, 0);
STRIP_NOPS (cur_obj);