This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24667] [4.0/4.1 Regression] -Wcast-qual fails to reject offending cast for a old style cast
- From: "fang at csl dot cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Nov 2005 17:56:28 -0000
- Subject: [Bug c++/24667] [4.0/4.1 Regression] -Wcast-qual fails to reject offending cast for a old style cast
- References: <bug-24667-3227@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from fang at csl dot cornell dot edu 2005-11-04 17:56 -------
Am I correct in expecting that const_cast<...> should pass -Wcast-qual without
warning? That's the way I use it (in the few and rare cases that demand it)
and it's met my expectations thus far. I'm kind of surprised I haven't tripped
this bug myself, but that's because I stopped using C-style casts long ago,
enforced by -Wold-style-cast -Werror. Adding -Wold-style-cast does trip a
warning about old casts with the posted code, but nothing further about
discarding qualifiers (gcc4).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24667