The following code produces 'casting away constness' error on 'static_cast' line. Should be no warning.
------------- code ----------------------- struct A { }; struct B : A { }; template<typename PTR> const PTR mycast(const A *a) { return (static_cast<const PTR>(a)); } const B* mycast(const A *a) { return (mycast<B*>(a)); } -- Summary: 'const' modifier is ignored in static_cast specifier Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yuri at tsoft dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25525