This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25525] 'const' modifier is ignored in static_cast specifier
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2005 22:54:51 -0000
- Subject: [Bug c++/25525] 'const' modifier is ignored in static_cast specifier
- References: <bug-25525-6649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2005-12-21 22:54 -------
GCC is correct:
const PTR mycast(const A *a) {
return (static_cast<const PTR>(a));
a is a pointer to a const A. While the cast you are trying to use is a
constant pointer to B. And that is invalid C++ to use static_cast to remove a
const.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25525