This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25525] 'const' modifier is ignored in static_cast specifier



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]