C++ PATCH to implement P1064R0, Virtual Function Calls in Constant Expressions

Jakub Jelinek jakub@redhat.com
Fri Sep 14 17:41:00 GMT 2018


On Fri, Sep 14, 2018 at 01:19:50PM -0400, Marek Polacek wrote:
> +	/* We expect something in the form of &x.D.2103.D.2094; get x. */
> +	if (TREE_CODE (obj) != ADDR_EXPR)
> +	  return t;

Shouldn't it then be a gcc_assert instead, or code like:
	if (TREE_CODE (obj) != ADDR_EXPR)
	  {
	    if (!ctx->quiet)
	      error (...);
	    *non_constant_p = true;
	  }
to make it clear that we haven't handled it and don't consider it a constant
expression?

	Jakub



More information about the Gcc-patches mailing list