On Oct 5, 2015, at 7:47 AM, Richard Sandiford <richard.sandif...@arm.com> wrote:
> -      return real_equal (&TREE_REAL_CST (expr), &dconst0)
> +      return real_equal (&TREE_REAL_CST (expr), &dconst<0> ())

On behalf of mere mortals, hiding the syntax &dconst<0> () into a header file 
as in implementation detail is entirely reasonable.


  return real_equal (&TREE_REAL_CST (expr), &double_const(0))

Also, in C++, we don’t like to mandate apis use & on their parameters, so the 
nicer form:

  return real_equal (TREE_REAL_CST (expr), double_const(0))

is preferred.  :-)  One you add conversion operators:

  return real_equal (TREE_REAL_CST (expr), 0)

and then with operator support, (if == would not be too confusing given the 
actual semantic of real_equal):

  return TREE_REAL_CST (expr) == 0;

and possibly even just:

  return expr == 0

in the end.  :-)

Reply via email to