Re: [PATCH] PR c++/71184: Fix NULL dereference in cp_parser_operator

2016-05-19 Thread Jason Merrill
On 05/18/2016 08:59 PM, David Malcolm wrote: + cp_token *close_token = + cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE); + if (close_token) + end_loc = close_token->location; You could combine these into if (cp_token *close_token

[PATCH] PR c++/71184: Fix NULL dereference in cp_parser_operator

2016-05-18 Thread David Malcolm
The source-range handling for the array form of operator new/delete erroneously assumed that the "]" was present, leading to a dereference of NULL when it's absent. Fix it thusly. Successfully bootstrapped on x86_64-pc-linux-gnu; adds 6 PASS results to g++.sum. OK for trunk and gcc-6-branch?