[Bug c++/24667] [4.0/4.1 Regression] -Wcast-qual fails to reject offending cast for a old style cast

fang at csl dot cornell dot edu gcc-bugzilla@gcc.gnu.org
Fri Nov 4 17:56:00 GMT 2005



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



More information about the Gcc-bugs mailing list