This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C++: Add fix-it hints for -Wold-style-cast
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, Volker Reichelt <v dot reichelt at netcologne dot de>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Apr 2017 22:51:16 +0200
- Subject: Re: [PATCH] C++: Add fix-it hints for -Wold-style-cast
- Authentication-results: sourceware.org; auth=none
- References: <b52e390f-b553-760e-2329-33c44a65470c@acm.org> <1493327424-21496-1-git-send-email-dmalcolm@redhat.com>
* David Malcolm:
> gcc/testsuite/ChangeLog:
> * g++.dg/other/old-style-cast-fixits.C: New test case.
Would it make sense to add a test cases for the non-fixable cases?
That would be:
void test_1 (const void *ptr)
{
foo *f = (foo *)ptr;
}
And:
const bar b_inst;
foo *f = (foo *)&b_inst;
These require const_cast plus static_cast or const_cast plus
reinterpret_cast.