On October 5, 2015 8:04:59 PM GMT+02:00, Mike Stump <mikest...@comcast.net> wrote: >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.
That would mean using references as parameters. I think we decided against this to make it more explicit what is a pointer and what not. > > 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. :-) Aww...