On 11/29/19 8:08 AM, Paolo Carlini wrote:
Hi,
a few more rather straightforward uses for cp_expr_loc_or_input_loc.
Additionally, while working on the latter, I noticed that, compared to
say, gcc-7, lately the code we have in cp_build_addr_expr_1 to diagnose
taking the address of 'main' often doesn't work anymore, when the
argument is wrapped in a location_wrapper. The below fixes that by using
tree_strip_any_location_wrapper in the DECL_MAIN_P check, which works
fine, but I can imagine various other ways to solve the issue...
Maybe
location_t loc = cp_expr_loc_or_input_loc (arg);
STRIP_ANY_LOCATION_WRAPPER (arg);
at the top? In general I prefer the local variable to writing
cp_expr_loc_or_input_loc in lots of places, whether or not we then strip
wrappers.
Jason