[PATCH] Fix constexpr evaluation of comparisons involving pointer-to-members

Jason Merrill jason@redhat.com
Wed Feb 3 16:06:00 GMT 2016


On 12/22/2015 12:07 AM, Patrick Palka wrote:
> +  if (code == EQ_EXPR || code == NE_EXPR)
> +    {
> +      if (TREE_CODE (lhs) == PTRMEM_CST && CONSTANT_CLASS_P (rhs))
> +	lhs = cplus_expand_constant (lhs);
> +      if (TREE_CODE (rhs) == PTRMEM_CST && CONSTANT_CLASS_P (lhs))
> +	rhs = cplus_expand_constant (rhs);
> +    }

If both sides are PTRMEM_CST, we should be able to compare them without 
expanding, using cp_tree_equal.

Jason




More information about the Gcc-patches mailing list