Fix location of sizeof/alignof (PR c++/80016)
PR c++/80016 reports an issue with bizarre underlined range for a complicated expression. The root cause for the incorrect *starting* location of that range is that alignof and sizeof expressions currently have start == finish == caret at the opening parenthesis of the expression. This patch fixes this by generating appropriate start and finish locations for alignof and sizeof expressions. gcc/cp/ChangeLog: PR c++/80016 * parser.c (cp_parser_unary_expression): Generate a location range for alignof and sizeof expressions. gcc/testsuite/ChangeLog: PR c++/80016 * g++.dg/plugin/diagnostic-test-expressions-1.C (test_sizeof): New test function. (test_alignof): New test function. From-SVN: r247108
Showing
Please
register
or
sign in
to comment