On 12/16/19 6:06 PM, Paolo Carlini wrote:
Hi,
another batch of work. Primarily, more of the idea of moving up the
construction of the compound location thus passing it to the
cxx_sizeof_or_alignof* and build_throw functions to obtain better
locations for all the diagnostics issued by the latter. During the work
a few mildly interesting nits (eg, for sizeof and alignof we want to set
whenever possible the location inside the cxx_* functions and that
allows to avoid set_location in cp_parser_unary_expression, but
minimally we have to pass it to the cp_expr constructor, otherwise
plugin testcases badly fail; noticed that in cxx_sizeof_expr and
cxx_alignof_expr having a single cp_expr_loc_or_input_loc on top
actually implies better locations (4 testcases) because below, before
the diagnostic calls, we have STRIP_ANY_LOCATION_WRAPPER uses; in fact I
changed those cp_expr_loc_or_input_loc to cp_expr_loc_or_loc because for
expressions we still want to try fetching the locations but we do have a
meaningful fallback in the location argument of the function; in
build_throw, an error should be an inform, because in such cases we
already issued an error (tested in ctor1.C)) but nothing major. The
below includes a few other minor changes, like two additional uses of
DECL_SOURCE_LOCATION, cp_expr_loc_or_input_loc, removal of an unused
function.
OK.
Jason