This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to implement P1064R0, Virtual Function Calls in Constant Expressions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Fri, 14 Sep 2018 19:36:47 +0200
- Subject: Re: C++ PATCH to implement P1064R0, Virtual Function Calls in Constant Expressions
- References: <20180914171950.GE5587@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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