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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247108 138bc75d-0d04-0410-961f-82ee72b054a4