C++: Add fix-it hints for -Wold-style-cast
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 21 Jun 2017 16:11:36 +0000 (16:11 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 21 Jun 2017 16:11:36 +0000 (16:11 +0000)
commit113459fad35faf22bcc72cee950e8f2ae573eb6f
treec2c83dd1eec5d1c040a6baba3c186f4de2b3dbf4
parentb10f10092ebcee637d04788f2ac8b72644dbba34
C++: Add fix-it hints for -Wold-style-cast

gcc/cp/ChangeLog:
* parser.c (get_cast_suggestion): New function.
(maybe_add_cast_fixit): New function.
(cp_parser_cast_expression): Capture the location of the closing
parenthesis.  Call maybe_add_cast_fixit when emitting warnings
about old-style casts.

gcc/testsuite/ChangeLog:
* g++.dg/other/old-style-cast-fixits.C: New test case.

From-SVN: r249461
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/old-style-cast-fixits.C [new file with mode: 0644]