This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C++: Add fix-it hints for -Wold-style-cast


* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]