This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]