C++: Add fix-it hints for -Wold-style-cast
commit681aa9957a9968404384254206163f9b52c8d82d
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jun 2017 16:11:36 +0000 (21 16:11 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jun 2017 16:11:36 +0000 (21 16:11 +0000)
treec2c83dd1eec5d1c040a6baba3c186f4de2b3dbf4
parentc44b93a4101f6e626e14bb9017661645e2bfea4e
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.

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