This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25525] New: 'const' modifier is ignored in static_cast specifier
- From: "yuri at tsoft dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2005 22:47:45 -0000
- Subject: [Bug c++/25525] New: 'const' modifier is ignored in static_cast specifier
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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